|
Hello,
I am trying to build an dll in .Net, using managed C++. But i need to use
another dll in my project. I have the xxx.dll file and xxx.lib file.
But i do not know how to set my project to link it to my project.
I know how to do that in Visual Studio 6.0 C++, in Project Settings--->Link,
add "/libpath:../../lib" under "Project Options" and add xxx.lib under
"Object/library modeules". But i do not know how to do this in .Net. I am a
newcomer in .Net
Thanks for your help!
vic
|
|
|
|
|
Use "Add reference" and chose your dll or your project.
If you have two projects in one solution you will see your project on the list
if not, then you have to browse
|
|
|
|
|
Dear Sir,
Thanks for your help.
The dll (let's call it xxx.dll) I am going to use is not built by my project AAA.
I have only one project AAA and it builds a new dll (let's call it yyy.dll), which uses the xxx.dll. The xxx.dll I am going to use is from a 3rd party.
When I tried to:
right lick "Reference" under my project AAA, select "Add Reference...",
then "Add References" window pop up. I clicked "Browse" on the right side of this window, and the "Select Component" window appears. In this window, I browsed and chose the xxx.dll (which is in the same place as xxx.lib), and clicked "Open". In the "Add Reference" window, lick "OK", I got a error message:
"Microsoft Development Environment"
"Add Reference: Error adding reference to the project."
Could you please tell me what the problem is and how to solve this?
Thank you very much for your help!
Vic
|
|
|
|
|
I don't uderstand what your problem really is. If you have a .lib file for the library that you want in your project you can just add it to the "Aditional Librarie" under the Include part of the Project Settings. You could do that, or user the #import "xxx.lib" in order to actually make the library *part* of your project.
|
|
|
|
|
Dear Mickanu,
Thank you very much for your help. The problem i met was solved. I can include the .h file and input the .lib file into the linker and my project can be compiled.
Thanks for your help.
vic
|
|
|
|
|
Hello,
I have a very difficult requirement to implement. I need to Base36 (0-9, A-Z) encode/decode a large number(up to 45 digits)string. For e.g. “7211750854866385693202841128538807157909”. I already have a routine that does this conversion but it doesn’t handle more than 64 bits(__int64). I have been thinking about this but have no clue so far L
Any tips/pointers?
Thanks!
|
|
|
|
|
You can use Struct
__gc struct encode
{
__int64 n1;
__int64 n2;
};
|
|
|
|
|
You can use an array of characer variables to store the large number.
|
|
|
|
|
I'm trying to interface a DLL parameter with .Net String variable.
How do I convert the .net String type to LPSTR used on DLL parameter ?
Like this:
LPSTR sUser = this->edtUser->ToString();
but this cause the following error :
error C2440: 'initializing' : cannot convert from 'System::String __gc *' to 'LPSTR'
Fernando Oliveira
|
|
|
|
|
|
Hi Folks!
For an interface to another application I had to develop a C++ dll implementing a given interface. For testing purposes I had a VB6 emulator to try out my dll.
Everything worked well, but now that the dll is loaded into the real program, a windows message I send to fire an event from a different thread gets lost (i.e. is not received by the window I send it to).
The dll is a mixed mode dll. I'm registering a managed event handler for an event of a managed remoting server and this event handler is called without problems.
In order to signal the event back to the host program I have to transfer it to the original thread the dll was loaded in.
In order to achieve this I create an MFC window in the original thread and send a registered windows message to this window from the event handler.
This does work flawlessly in the test program, but when the dll is loaded into the real host application, the window doesn't receive the message.
Has anyone experienced something similar or can give me any hints on why this could be?
Thanks in advance,
mav
|
|
|
|
|
Update:
I was told my dll seems to work when the host application is not being run in the debugger.
I've read Surviving the Release Version[^] and think it could be related to mixing debug and release MFC (since I've delivered my dll as release build), but I'm not sure.
Nevertheless, any help would be greatly appreciated...
mav
|
|
|
|
|
Hi everybody
How can an application interact to a Windows Services or transact with it?
Tanks for your help
|
|
|
|
|
|
Hi...
Excuse me!
What is your mean?
|
|
|
|
|
|
Generally, through some form of inter-process communication, although for some simple interactions (start, stop, pause, resume a service) SCP is more than enough.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Hi!
Thanks for your help
But What is the "SCP" ?
Please explain more obviously!
|
|
|
|
|
|
I'm basically playing with static libraries, with header files that don't have any cpp files...i.e. all code for all header files in static library is inlined, and vs.net won't compile unless i include a cpp file that calls the header files.
Is this a normal practice with other compilers, or just for vs.net...and if just for vs.net, is their an option to disable that?
|
|
|
|
|
Right Click your header file ander soluton explorer and chose properties and under general chose don't use precomiled headers.
ps: I know this will work, but i am not 100% exactly where to find this setting, because i use public pc
|
|
|
|
|
hi for all
This is a simple question but I have no idea how I can do this:
How can I read all lines from a file and insert a new line in a specific local?
thanks a lot for all
Alex Cutovoi
|
|
|
|
|
<br />
#include <fstream><br />
std::ifstream ifs("path/to_file");
if (!ifs.is_open())<br />
{
<br />
std::string all_file,line;<br />
while( !ifs.eof() )<br />
{<br />
getline(ifs, line);<br />
all_file += line;<br />
if (line.empty())
continue;<br />
}<br />
after this while exists, you have in all_file, well, all file ...
then you can insert your stuff in string all_file, close the original file open it with "w" or so (make sure the write poinetr is at the beginning of the file), and then write the modified content, that is all_file.
-- modified at 3:16 Thursday 6th October, 2005
|
|
|
|
|
This is managed c++ forum, so it would be better to post managed code
|
|
|
|
|
to anonymous:
yo dude, according to my knowledges this forum is also related to plain C++ !!!. And beside that, reading all lines from a file, should merely follow the same idea, even in managed C (that is C#, not C++ ), right ?
Regards,
gecool
|
|
|
|