 |
|
 |
Hi, my problem is more or less same. A function in the Dll has to be called only once, but how would another application know whether it has already been called?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It can be handled using the same approach as discussed in the example above. in the shared data segment a flag variable can be set when ever the function ges called...in the another process before calling the funtion, the process can check the flag to know about weather the funtion get called or not?
Happy programming.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
How to share data between two different processes that are using same DLLs. I have used #pragma data_seg("SHARED") int foo=0; #pragma data_seg() #pragma comment(linker, "/section:SHARED,RWS")
But this works for only 1 type of exes (2 EXEs - of same projects.
Any suggestion???
AmolM
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Is it possible by #pragma data_seg("") like or any other way to share the file ?
and Is there any way to share a data( other than #pragma data_seg(""))
Regards, Rammy.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
i want to share data between some processes. my data is structured and have pointers. please help me as soon as posible! thanks for help from every one.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
I have a slightly differnet case to deal with. I am running a DLL as main application (since it is loaded by JNI), and the application will load another DLL. Basically, they are different DLLs working in the same process. However, they share some same data structure. The thing I would like to do is to share some of static/global variables, which come from the same LIB file.
Does anyone know how to fulfill that? I tried the data segment but it seems not working . I have put the #pragma statement in my source for LIB file. It compiles and links well, but still, the data are not shared.
Thanks a lot.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi,
I'm writing a dll which access a com port and will send and rec data from this comport to another device.
This Dll will be loaded by 2 different ocx to access the device.
I tried using 2 different application to access this dll concurrently but only the first application is able to send data through the com port.
I've tried to put the my serial Class in the shared data seg as describe here but to no avail.
Could anyone help? 
Learner
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I have some problem with inpout32.dll in win32 console application project my code is:
#include "stdio.h" #include "string.h" #include "stdlib.h" /* ----Prototypes of Inp and Outp--- */
void _stdcall Out32(short PortAddress, short data);
/*--------------------------------*/ /*
int main() {
Out32(888,20);
return 0; } but in MFC project ,it error (i use the same code ,except int out() {
Out32(888,20);
return 0; }
Linking... thulpt1Dlg.obj : error LNK2001: unresolved external symbol "void __stdcall Out32(short,short)" (?Out32@@YGXFF@Z) Debug/thulpt1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. thulpt1.exe - 2 error(s), 0 warning(s)
how can i solve it ? please help me
dnqhung
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
My understanding is that you should not use #pragma data_seg("SHARED"), if pointers are to be shared in the DLL.
See: http://support.microsoft.com/default.aspx?scid=kb;EN-US;100634
Since I had to share pointers in my DLL, I used FileMapping with a Mutex to synchronize access. This seems to work, although I am still a bit confused with some of the details.
I would be interested if someone else has used FileMapping/Mutex or other technique to share pointers in a DLL.
Bob
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
Im trying to setup a dll that opens files and reads data. The data is then stored in the dll and both plugins and the main program can access the data. Im writing test dlls to test the concept but im having a bit of trouble opening the file from the dll; the open from stdio fails. Any suggustions?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I have this message after exe compilation : LINK : fatal error LNK1104: cannot open file "..\TestMemorySpace.lib" what happend?:(
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The process has worked for but the paths cause problems for people because the directory structure was flattened during editing.
See response "Re:Could not get it to compile" in this thread.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi i have a c dll which is being called by a c exe. MY setting when compiling the debug or release version of this dll are exactly the same. However, my release version works and debug does not I am clueless at the moment. Has nyone out there come across a similar situation ?
Thank u in advance for your help
newbee78
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi i have a c dll which is being called by a c exe. MY setting when compiling the debug or release version of this dll are exactly the same. However, my release version works and debug does not I am clueless at the moment. Has nyone out there come across a similar situation ?
newbee78
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Even though I followed your suggestion regarding the structural layout (or relationship) between "TestDLL" and "TestExe", and also which one should be built first, the following is the error message obtained from compiling "TestExe":
Cannot open include file: '..\TestDll\MyClass.h': No such file or directory
The strange thing is, "MyClass.h" does exist. It is right there in the "TestDll" directory, as well as present in the project workspace. So why the compiler is saying it can't find the file, is beyond me; totally beyond me! (Any help you can offer in this regard would be greatly appreciated.)
With regards to this article, I see it as something that could come in very handy and useful in more ways than one, and would very much like to do some experimenting with it to test its limits.
Thank you for sharing it with us.
William
Fortes in fide et opere!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I just unzipped all files using directories to C:\MyTest.
Then I 'moved' not copied TestExe folder inside TestDll.
At this point I had. C:\myTest c:\mytest\TestDll C:\myTest\testdll\testexe
Then I build the dll, and then the exe.
Next I started two copies of the exe and it seemed to be fine.
statement #include "..\TestDll\MyClass.h" is your problem, if you right click on this it should open for you. If it does not rebuild dependencies or edit your directory structure.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Compiled, linked and ran fine. Now it's on to deeper investigations.
Thanks for the blood, sweat, and tears you may have put into this sample. We all appreciate it.
William
Fortes in fide et opere!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Is placement new operator defined for class that is to be stored. So speak elders in my tribe anyway. haven't tested it yet
|
| Sign In·View Thread·PermaLink | 1.83/5 (3 votes) |
|
|
|
 |
|
 |
There are some problems when it working on Release way ,somebody told me you have to change the code in the way for Release. how to change it??
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
It has been four or five years since I wrote this.
The three basic problems people have are.
1. The two exe's must share the same instance of the dll. That means they must be using the same path and loading the same object.
2. The shared data is not initialized.
3. Only values can be shared. A reference to another place in memory would break the vitural memory rules.
Good luck.
Phil
|
| Sign In·View Thread·PermaLink | 3.00/5 (2 votes) |
|
|
|
 |