Jump to content
Xtreme .Net Talk

Jell

Members
  • Posts

    13
  • Joined

  • Last visited

Jell's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. The DLL had to be put into windows/system32 folder
  2. I have written a vc++.net web service. This web service should load a c++ DLL. but when i run my web service i find that my DLL is not loading. where should i put (in which path/directory) the DLL, so that the web service can load it? ps: right now i have tried putting it in Project Folder(where rest of my web service code is)...and also in virtual directories Bin folder...but DLL Is not loading when put in these 2 places.
  3. I wud explain my problem in more details.. In vc++6 for loading a DLL at Load time, we used to follow the steps i had enlisted in my first query. I tried using the same steps with vc++.net web service...they dont seem to function.. so i think there must be some more things to consider while trying to load libraries in vc++.net at load time...of which i am totally ignorant..
  4. problem loading DLL I havent used HrLoadAllImportsForDLL ...i am trying to use it now but my code is not compiling...it is not recognizing "__HrLoadAllImportsForDll" , so its giving an error "__HrLoadAllImportsForDll': identifier not found, even with argument-dependent lookup" i tried using #include delayimp.h also... also, in an example in MSDN i saw that for loading they havent used any primitives(__HrLoadAllImportsForDll)...they have simple specified the dll to be delay-imported and specified the method name to be called in the code like any other normal method call... the code is pasted below from msdn:: ============================================ #include <windows.h> // uncomment these lines to remove .libs from command line // #pragma comment(lib, "delayimp") // #pragma comment(lib, "user32") int main() { // user32.dll will load at this point MessageBox(NULL, "Hello", "Hello", MB_OK); } Build the DEBUG version of the project. Step through the code using the debugger and you will notice that user32.dll is loaded only when you make the call to MessageBox. ===================================== ur suggestion sounded a way out initially....but i am all the more confused... i just want to load the library to my project...and i am unable to do that...thats my problem...
  5. In my web service i am loading a native c++ DLL at Load time. This Dll exports a method which i need to use in my web service. For this i have done following settings: I have copied the Lib file and the DLL into my project folder. I have specified lib file name in Project->Configuration Properties->Linker->Input->Additional Dependencies and specified DLL name in Project->Configuration Properties->Linker->Input->Delay Loaded Dlls In my web service's ".cpp" file i have added "# include" for the native Dll's header file and also a _declspec(dllimport) for the exported function as follows: #include "CppClassExport.h" __declspec(dllimport) int fnCppClassExport(void); still i find that the DLL is not loading into my web service application when i am running the web service...hence the method is not getting called.. ( i chked using Debug->Windows->module) any idea if i have missed anything else required for Load time DLL loading..???
  6. I am importing a DLL into my managed C++ code, using DllImport. This DLL exports a class... and does not exports its methods explicitly. How can i access the methods of this class in my managed code??
  7. I have created a web serivce in vc++.net using Visual c++ Projects->ASP.NET Web Service I m importing c++ DLL into managed c++ code. For this i have done 2 things: 1. Copied DLL into the project folder 2. Used DLLImport to import the dll. on building the solution i am getting 2 link errors: error 1: LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup error2 : LNK1120: 1 unresolved externals Have i missed doing something needed for linking??? Project configuration is Win32 debug. I dont get rid of these errors
  8. I want to write web services in vc++ (Reason: I am actually building a web service wrapper to a legacy application, so that the legacy functionality can be accessed from anywhere on the web. I tried making web service in c# for it but got too stuck in marshalling classes (which encapsulated both "data+ methods"), so i am opting out for vc++.net ) On clicking on New->Project->Visual C++ projects i can see only ASP.NET web services... when i click on that... and after that i am completely lost :( i have developed web services in C#...but vc++.net project workspace seems like an alien world...please help out...
  9. My Problem is: 1.The following C++ method has to be called from C# code. GetNames(& CStringArrayObject) 2. This function takes a pointer to CStringArray object. 3.Right now the approach i am using is: Use PInvoke to use C++ DLL in C# code. and then marshal the data from C# to C++. I am stuck because : I dont know how to apply marshalling in this case(passing a class to the function by reference)?? SHould i use some other way of loading DLL that wont require me to use marshaling? PLEASE HELP
  10. I am facing this problem 1. I have to load a C++ DLL into my C# code. 2. The method in the DLL which i want to access is GetNames(&strCStringArrayClass) This method takes a pointer to the CStringArray Class Object and populates the array of strings. If I use DllImport (pInvoke) method, how should i write the prototype for the exported method??? is there any other way of doing this? Please Help
×
×
  • Create New...