Nitin wrote: > After taking a Dump using dumpbin /export I can view that the => > NS_InitXPCOM2 is exported as follows : > ================= > O/P of => Dumpbin /exports > > 1619 652 0000481F >?NS_InitXPCOM2@@YAIPAPAVnsIServiceManager@@PAVnsIFile@@PAVnsIDirectoryServiceProvider@@@Z > ================= > As well as I tried using LoadLibrary for XPCOM.DLL and queried for > NS_InitXPCOM2 this was also successful.
The function you list isn't NS_InitXPCOM2, it's probably further down. In any case if you did LoadLibrary and then GetProcAddress and that worked, then it's probably there. > Can you please shed some more Light on the failure of NS_InitXPCOM2, > for Netscape's XPCOM DLL. You say you are using the XPCOM.DLL from Netscape 6.2. Where are you getting the .lib to link against, and the header files? These need to be in sync. If you really need to use the 6.2 one, then you'll need to get or build the corresponding .lib and headers. > One more question I face is that can we avoid using the SmartPointer > (nsCOMPtr)? If yes, please let me know how? with a sample if possible. Here's where you're going to run into problems. Currently the only real way to invoke a method is from C++. What you would need to do is provide a C wrapper around the XPTC_InvokeByIndex function and nsXPTCVariant. Once this is done, you can then manually invoke AddRef and Release methods, to effect what nsCOMPtr is doing. David B.
