|
Fine that all is working. You are always welcome.
Just one more note:
You may replace the include of winsock2.h by afxsock.h in stdafx.h. Then you did not have to add the library to your project. That is done by import statements in afxsock.h and atlsocket.h:
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "mswsock.lib")
When creating a new MFC project and selecting "Windows Sockets" on the "Extended Features" tab, this will be already present in stdafx.h.
|
|
|
|
|
I have an extension dll. when I am building the dll in release mode, and call from the client mfc application it's launching, but when I am bulding the dll in debug mode and loading from client mfc application it's not launching giving error
//////////////////////////////////////////
debug assertion failed.
program:
file: f:\dd\cvtools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
line: 451
For more information on how your program can cause assertion failure, see visual c++ documentation on asserts
(Please retry to debug the application)
//////////////////////////////////////////
Please help me why this error is coming I am trying to launch the dll like this
[code]
hinstLib = LoadLibrary(L"C:\\Users\\sujan.dasmahapatra\\Documents\\Projects\\Bhagavan_SurfaceRevolution\\View inside a Dialog\\package\\RevolutionDLL\\debug\\dlltest.dll");
[/code]
when there is 'release' instead of debug it's working fine. Please help.
|
|
|
|
|
sujandasmahapatra wrote: when there is 'release' instead of debug it's working fine
probably not. but debug assertions don't happen in release mode. they're there to tell programmers that something seriously wrong has happened.
your best bet is to duplicate the problem in a debugger then see why that assertion is happening. then fix the problem.
|
|
|
|
|
sujandasmahapatra wrote: file: f:\dd\cvtools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
line: 451
Debug your code (single step), go to that line number and see what's asserting.
Read this excellent essay: Surviving the release build[^]
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
"Break" execution when the assertion is hit, then look at what the assertion is telling you. You can see what has been asserted (example):
ASSERT( pWnd );
ASSERT( pWnd!=NULL );
Then you can look at the call stack and trace back to your code (instead of looking at the mfc portion that triggered the assertion). You probably forgot to initialize something or did something incorrectly within the framework.
|
|
|
|
|
file: f:\dd\cvtools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
line: 451
You can debug the code at specified location or post that code here.
|
|
|
|
|
The assertion is telling you the file name and the line number in the file. Have a look there and read the comment which no doubt accompanies the assertion.
Steve
|
|
|
|
|
|
By studying the vCard format[^] or Googling for vCard parsing[^] to learn how to do it (or at least find a useful tool already written for this purpose). Even CodeProject[^] has some answers, you just have to listen.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Hi!
I am going to create a shared dll n(C++, VS .NET 2003 or VS 2008) that acts as an intermediate data source. The dll will be loaded by one application (not mine) that extracts data from the dll.
My application (C++ VS .NET 2003) is on separate PC. I want to load the shared dll and then send data to the dll.
Can I use LoadLibrary()? What commands do I use to do this over tcp/ip?
Thank you, Pia
|
|
|
|
|
Your question isn't too clear. Yes, you can use LoadLibrary to load a DLL and yes, you can use TCP/IP to send data between two computers. But it isn't clear what the connection between these two is in your context.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
More details:
I own an application running on one computer. There I can add code to access the remote dll methods. I will write the remote dll.
I do not own the other application that will access my dll locally.
The functions in the dll and my application will be simple. I will send data repetitively to the dll using a function call.
Are more details needed and what details?
The two computers will be in the same room or close, probably in the same local network. I had an idea to mount the remote folder on my PC but it does not seem possible.
|
|
|
|
|
Why do you need to load the DLL in your local application? The remote application loads your DLL, your DLL then listens on some (TCP) port and you can connect to it from your local application and send data as needed. Wouldn't this work?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Is this a simpler way? Do you have a code example?
I need to inform the dll that I have started sending data so that the dll can change state from Unknown to Running. However the dll can have logic enough to know that if data arrives then the sending has started .
I may have to send 3-4 parameters of data simultaneously.
|
|
|
|
|
I don't see the need to load the very same DLL into both applications based on what you said, so i'd say, yeah, it's probably simpler. Not sure what kind of example you mean, there are loads of tutorials and examples around the web for creating DLLs and communicating over the network, just google for things like Windows Sockets[^] and Writing DLLs[^]. What else would you need?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
|
You cannot use LoadLibrary to load a remote DLL .
You must call LoadLibrary on the local machine wherein the DLL is.
For instance, COM allows you to call methods of remote components hosted in DLL s because it creates a stub process in the machine wherein the DLL s are.
Veni, vidi, vici.
|
|
|
|
|
So I accept I have to use DCOM instead of the "simple" LoadLibrary
Can you please point me to a code example/tutorial on how I call methods in my remote DLL (not .exe)using DCOM?
Alternatively add a code example?
More details:
I own an application running on one computer. There I can add code to access the dll methods. I will also write the dll.
I do not own the other application that will access my dll locally using LoadLibrary.
The functions will be simple. I will send data repetitively to the dll.
Thank you!
Pia
|
|
|
|
|
Actually you don't need DCOM (you may use it if you like), you may use RPC s or implement you own TCP mechanism to communicate with the remote executable that loads the DLL .
CodeProject has some articles[^] about DCOM .
Veni, vidi, vici.
|
|
|
|
|
Which way is the simplest/easiest to learn and create?
Do you have a code example of which function calls I have to make?
|
|
|
|
|
I don't know, after all it depends on your requirements. You could read some articles here at CodeProject (either on DCOM or RPC or TCP client/server programming) and then choose the technique that better fits your need.
Veni, vidi, vici.
|
|
|
|
|
|
I think you should have searched CodeProject at least now.
|
|
|
|
|
You have two computers A and B.
Executables run on A.
Executables run on B.
You cannot make anything run on B 'magically'.
When two computer 'talk' then both computers must be running something.
Now you can do the following.
1. Write a server, call it T. The server, code you wrote, loads a dll when a command is 'sent' to T. Not that the server must follow all of the restrictions for loading a dll into an application.
2. Write a client, call it M. That client sends the command to T.
Given the above then:
A must run M (client)
B must run T (server)
AFTER that, then B can, vian the client T, cause A to load a dll.
Restating it again, there is NO way to 'magically' make a dll load onto another computer. There MUST be a server of some sort running on the remote computer.
|
|
|
|
|
Hi every one
I have simple code and think and ask other for 2 weeks . And now i have found out how to fix it yet . When I click button for first dialog , it is ok to show another dialog . But when I click button in that dialog in order to show message or do anything else , no thing happens . I follow basic way to add event . First resource and then add class , at last add event handler . But many times ,it does not work ! .
http://www.mediafire.com/?8pppqsnbglzrvb2[^]
Thank you
hi world
|
|
|
|