|
Have you correctly exported your function names with __declspec(dllexport) ?
It's time for a new signature.
|
|
|
|
|
No.This dll is given by a vendor.This is not our dll.
|
|
|
|
|
Karthika85 wrote: This dll is given by a vendor.
Then they are the people you need to talk to, as they should have both the source code and the instructions on how to use the functions.
It's time for a new signature.
|
|
|
|
|
|
Put this before class and function names that you want to export from the dll.
extern "C"
This will prevent the C++ way of mangling the names. Theres nothing wrong in mangling but if you export a function like
int Sum(int, int) C++ will NOT reduce that to _Sum, like C and like you might expect. That means when you import that into your program, you can't simply search for "Sum" but have to follow C++ name mangling rules and search for THAT name.
...byte till it megahertz...
|
|
|
|
|
For example, a game only supports connecting in one lan. How to make it connectable via Internet?
VPN?
|
|
|
|
|
Your question isn't really a C/C++/MFC related question, you should try a more suitable message board. However, VPN could work, but as far as i know some games use broadcast packets to find their servers on the lan but broadcast packets aren't submitted through internet via VPN (i might be wrong of course). In this case, you might try somesort of tunneling, like an SSH tunnel or somesuch, maybe that could work. Come to think of it, trying the tunneling might even be a better choice at the first place.
By the way, just so you know, it might be illegal to do what you wish if the makers of the game charge players extra for internet gameplay and you are trying to avoid paying by making a LAN game go thorough the net.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I am highly used to C than C++, but now I'm trying to understand C++ as well. I have fstream object which I used to create a file for output.
What I want is that if there is any file write error, the file that was created should be removed from the disk. What is the name of the method that I should invoke with the fstream object to remove the file from the disk, as it is done in C using remove() to accomplish such a goal? Please help.
|
|
|
|
|
|
I think DeleteFile is Windows specific, so I wouldn't want that one. I will use remove() rather. But does it mean there is no method in C++ to be used for such a goal?
|
|
|
|
|
Dan_K wrote: But does it mean there is no method in C++ to be used for such a goal?
Not that I am aware of, as these functions are beyond the scope of the C++ language. If you include <cstdio> [^] you can then use it in the form std::remove() .
It's time for a new signature.
|
|
|
|
|
as you know, C++ is a super set of C, and you are always free to use C functions wherever in C++ code
|
|
|
|
|
I want to capture ip packet sent by an application, and modify the packet then resent it.
The destination host should receive only the modified packet.
I found a solution that using hooking, but I don't know whether it will work with packet that is sent asynchronously.
A filter driver will work, but I'm not very familiar with that now.
Any other solution?
Thanks.
|
|
|
|
|
|
Hi all,
i m creating property sheet in my application.
i want to set font of all property pages and property sheet so i m using this article to set font of property sheet.
http://support.microsoft.com/kb/142170[^]
here is a problem help button not display in the property sheet.
i want to use help button on property sheet.
so please help me for this.
thanks in advance.
|
|
|
|
|
I have one MFC project which listents on some COM port and fires events when something happens.
Now I want to create a dll for it so that I can reuse it in .NET projects with C#.
First Question : Is it right to make a dll of it, if not then what are other ways?
Second Question : If I go for making dll then how my dll will fire events or send information to C# application, any example ?
I am also looking into this[^]. Am I on right track?
|
|
|
|
|
The answer, as usual, depends. What you propose would be one solution to the problem. However, you may also like to consider the .NET support for Serial.IO[^], which could be a better solution for a C# program.
It's time for a new signature.
|
|
|
|
|
Well Richard and Luc!
This is the restriction, I have to go with that code because our company does not want to re-write the code in .NET because of Time Limitation, so tell me how to access classes or functions of MFC dll inside C#. There are several threads and articles so I am confused how to go ahead.
Thanks,
Rahul Kulshreshtha
|
|
|
|
|
I have not tried this with MFC classes, I have only used P/Invoke on ordinary Win32 functions. I would suggest reading some of the articles here[^].
It's time for a new signature.
|
|
|
|
|
Within a .NET application I would not rely on native code for things that can be handled equally well with managed code. As Richard said, consider the all-managed approach.
|
|
|
|
|
I would suggest to write it as a COM dll. Its easy as starting an ATL COM project and wrapping the functionalities in co-class. COM components are easy to use in C# projects just by adding a reference. then no more dll import codes needed.
|
|
|
|
|
I am sorry if this query is off-topic here; please tell me the correct place for it. I use Visual C++; before that I used Borland C++ 4.51. Programs need a help (a file with extension .HLP); for a long time I used a help-maker program which made .HLP helps in the old style which Microsoft does not support now. If I call a new commercially-written Windows application, and call its help, the help comes in a new format and will not read old-type .HLP helps. So far since the change of help system I have been making my new programs' helps as plain .TXT files or suchlike. Please:-
(1) Where is a program to make helps in the new format?
(2) Where is a program to translate an old-type .HLP into a new-type help file?
|
|
|
|
|
|
Anthony Appleyard wrote: (1) Where is a program to make helps in the new format?
(2) Where is a program to translate an old-type .HLP into a new-type help file?
1) You can use any help authoring tool capable of generating CHM -files (HTML help), see Wikipedia.
2) Performing a quick Google search... there are a couple of tools available, see convert HLP CHM.
It's weekend, yay!
/M
PS: Users don't like reading documentation, don't spend too much time on it.
|
|
|
|
|
Thanks.
If s is a char* -type variable containing the name of a *.chm-type file, please how do I call it as a help file?
With the old help I used a format like:
case _HELP_: WinHelp(wn,PROGNAME".HLP",HELP_CONTENTS,0); goto DEF;
|
|
|
|