-
September 30th, 2008, 08:36 PM
#1
[RESOLVED] Dll and its location
I have created a C# dll and call that dll in my VC++
In my VC++ i simplly have included
Code:
#import "C:\Mydot-net-projects\sManagedDLL\sManagedDLL\bin\Debug\sManagedDLL.tlb"
...
...
I run this to register my dll and create the tlb file
Code:
>RegAsm.exe smanageddll.dll /tlb:smanageddll.tlb /codebase
Code:
HRESULT hr = CoInitialize(NULL);
ICalculatorPtr pICalc(__uuidof(ManagedClass));
....
char_t *p=static_cast<wchar_t *>(pICalc->Get(szTemp1,szTemp2)); // call the Dll
Now The problem is that my VC++ caller expects the Dll to be found at a fixed location on C drive
which is
C:\Mydot-net-projects\sManagedDLL\sManagedDLL\obj\Debug .
That is becuase once the dll is deleted from that folder the Vc++ crashes when its attempting to call the dll
Whatsetting do I need to change on my C# project to make sure the VC++.EXE caller can find the dll where the .EXE is residing rather than
C:\Mydot-net-projects\sManagedDLL\sManagedDLL\obj\Debug becuase once the dll
Last edited by Saeed; September 30th, 2008 at 08:58 PM.
-
September 30th, 2008, 10:26 PM
#2
Re: Dll and its location
I can actually run this on my PC where the tbl points to my dll where it was created.
Once the EXE goes into another machine because that folder s not there with the DLL in it it wont work.
-
November 24th, 2011, 09:58 AM
#3
Re: [RESOLVED] Dll and its location
Hello,
i am facing the same problem, how did u solve it?
-
November 24th, 2011, 05:35 PM
#4
Re: [RESOLVED] Dll and its location
HI
I m sorry but I dont recall what the remedy was.
I somehow fixed the issue and the project is working but Cant remember what I did.
-
November 25th, 2011, 11:03 AM
#5
Re: [RESOLVED] Dll and its location
hello,
can you please try to remember it, i've been woring on that since a week and no results for the moment.
Thank you in advance
-
November 25th, 2011, 03:36 PM
#6
Re: [RESOLVED] Dll and its location
give me your email and i will send u my proj on MONDAY , its the Weekend now
-
November 27th, 2011, 11:35 PM
#7
Re: [RESOLVED] Dll and its location
You just need to register the dll on the target machine (I.e. run regasm.exe).
-
November 27th, 2011, 11:40 PM
#8
Re: [RESOLVED] Dll and its location
In compliment to what Aray said I hope you have not forgotten to register your dll
>RegAsm.exe smanageddll.dll /tlb:smanageddll.tlb /codebase
You have to run this command before being able to call the dll from C++.
http://support.microsoft.com/kb/828736
Last edited by Saeed; November 28th, 2011 at 12:30 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|