• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem in calling function of the loadable bundle!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem in calling function of the loadable bundle!!!


  • Subject: Problem in calling function of the loadable bundle!!!
  • From: Jenis Shah <email@hidden>
  • Date: Wed, 27 Apr 2005 19:43:54 +0530

Hi all,

        I made a simple bundle which has just one function as below:

            void fun()
	{
		static int i=0;
		return ++i;
		printf("The value of i is %d",i);
	}

Now I wrote a code to call this function from outside the bundle:

=====================================================

CFURLRef bundleURL;
CFBundleRef myBundle;
// Make a CFURLRef from the CFString representation of the
// bundle's path.
bundleURL = CFURLCreateWithFileSystemPath(
                kCFAllocatorDefault,
                CFSTR("/bundles/MyBundle.bundle"), //where
"/bundles/MyBundle.bundle" is a path
                kCFURLPOSIXPathStyle,
                true );
// Make a bundle instance using the URLRef.
myBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );


// call the function of the bundle MyBundle


// Declare the Function pointer.
void (*funptr)() = NULL;

// Get a pointer to the function.
funptr = (void*)CFBundleGetFunctionPointerForName(
            myBundle, CFSTR("fun") );
// If the function was found, call it with a test value.
if (funptr)
{
	(*funptr)();
}



================================================================

But I am not able to call the function. I am able to create the bundle
successfully.
But while calling the function of it I got the error saying "Program exited
due to Signal 10 ( SIGBUS )".

So please let me know any settings are required in bundle to export the
function ?
OR
Is there any mistake in calling the function of the bundle?

Waiting for the reply....




     Thanks,
   Jenis Shah
InterraIT Information Technologies Ltd.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem in calling function of the loadable bundle!!!
      • From: Finlay Dobbie <email@hidden>
  • Prev by Date: Re: mysterious breakpoint?
  • Next by Date: Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
  • Previous by thread: RE: Internal Error (IOKit Project)
  • Next by thread: Re: Problem in calling function of the loadable bundle!!!
  • Index(es):
    • Date
    • Thread