|
A .def file (where you list exported functions) is of the form :
LIBRARY "COMServerPS"
DESCRIPTION 'Proxy/Stub DLL'
EXPORTS
DllGetClassObject @1 PRIVATE
DllCanUnloadNow @2 PRIVATE
GetProxyDllInfo @3 PRIVATE
DllRegisterServer @4 PRIVATE
DllUnregisterServer @5 PRIVATE
To replace your static library with a DLL, you have at least two options :
- edit the existing .dsp file :
-> replace 0x0104 to 0x0102 (in the TARGTYPE line)
-> remove -lib (in link.exe -lib)
- create a new .dsp
-> VC6 : Win32 dynamic library
-> VC7 : Win32 project (and then check DLL in the propertysheet)
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Ok my exports does look like it, it compiles to a 286kb blob of #$%#$
But the exports viewed in w32dasm doesnt point anywhere.
This is what I not wanted in the 1st place, A lesson in C++. I just want to use the dll from C#, but it is distributed as a lib and I'm clueless how to do the conversion to dll.
Can I mail it to someone willing to do it? It's just 4 functions. Its small 160kb. Please
Thanx in advance!
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
The scenerio: if I start my application from the task bar I cannot use the open or new dialog menu options. It will not open the "save" or "open" dialog boxes. However if I start the application using the icon shortcut from anywhere on my hard drive, the application works normally. The application is effected the same way if I use the start menu. Is there something different with the Task Bar that would affect win32 applications in this fashion?
Thanks!
|
|
|
|
|
It seems to work in all the tests that I did.
Is the save/open dialog invoked by your code or is it the MFC framework code?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
In each case where I'm expecting a dialog to open is when I'm involking the CFileDialog class. That is, when saving I call this class with the proper constructor to open a save dialog box and similiarly when I call open.
thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
Hi,
I'm sure there is a easy method for this, but I cannot see for looking !
Q. Is there any method to force the Nonclient area of a window to be redrawn/recalculated ?
The only methods I can see, affect the client area of a windows.
At the moment I am increasing the size of the windows then reseting it back to the original size.
My other solution was to recreate the window.
Both of thse solutions work, but they are obviously work-arounds, and I would like a more "professional"
solution.
Thanks,
Gary Ranson.
|
|
|
|
|
Call RedrawWindow with RDW_FRAME.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Now I am developing a tool to simulate user input (keyboard and mouse input) to other applications on windows. The problem seems to be the program doest not work like I expected when I use SendMessage or PostMessage to send keyboard and mouse input to other applications. For example, the user input steps are: mouseclick an editbox in an application’s window, type a string , and then mouseclick another editbox in the window , type another string ; First I send a mouse message to the first edit box to get focus, and send keyboard messages to type the string in the first edit box, then send a mouse message to the second edit box to get focus, and send keyboard messages to type the string in the second edit box. But the result is not what I expected. What’s the matter at all? And if I post a mouse message to click a button, then open a model dialog, but I send any message to the controls in the dialog box , nothing happed. I expect my program can work like some testing tools, such as QARun, Robot etc., to control applications and simulate user input. How should I do? Can you give me some suggestion? Thank you very much!
waiting for your help ^_^
xia
|
|
|
|
|
look at keybd_event() and its brother mouse_event()
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Thanks for your help! I have just solved my problem by using mouse_event() and keybd_event(),instead of using SendMessage(). The program works as i expected.
|
|
|
|
|
Hey, what's this field for?
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Our test team are developing a tool like QARun & Robot. You may ask me why we develop our own tool and do not use the professional tools. My manager thinks these tools can not help us to run testing well. He wants the new tool can get every GUI object's information easily on windows, and can accomplish the keyword-driven framwork well. Now the problem we meet is: we can not control the be-tested software well by using a series of keybd_event() and mouse_event(). I need the tool can simulate user inputs just like we do manually. Can you give me some advice?
thanks,
xia
|
|
|
|
|
Can two applications (running on two or same machine) broadcast data on the same multicast group? If yes, how is the message integrity preserved - i mean like messages getting intertwined ( part of msg1 .. part of msg2 .. rest of msg1 etc...)
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote:
Can two applications (running on two or same machine) broadcast data on the same multicast group?
Yes.
If yes, how is the message integrity preserved
Not. Multicast is UDP, which by the very definition is unreliable.
i mean like messages getting intertwined ( part of msg1 .. part of msg2 .. rest of msg1 etc...)
That won't happen. You can get a complete message, a partial message (f.ex. if you exceed MTU) or no message from recvfrom(). Messages never get "blended" like this.
|
|
|
|
|
Thanks for the answer. I am not worried about partial messages or lost messages or partially lost messages. "Blending" was the only thing I was bothered about.
Thank you very much
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Guys, I've problem reading binary files using the following code. It works text/wri. Can you guys spot an error in this? Specifically, the pBuf in the code loads 0 or null after a certain number of loops even though the file huge.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Any ideas?
Thanks.
JJ
|
|
|
|
|
the pBuf in the code loads 0 or null after a certain number of loops
Binary data can have null characters
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
So, Papa, how do I make sure the end of file has been reached? Still from the number of bytes returned from reading, right? But, my problem is that my buffer reads and loads "" into it..more likely, it loads nothing in the buffer.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Thanks,
JJ
|
|
|
|
|
it does read, and fill the right values, but the prob is if u try to output it using a messagebox for instance it wont show cos the chars ur trying to print aint printable !
U can see an ascii table for more info
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Merc wrote:
Guys, I've problem reading binary files using the following code. It works text/wri. Can you guys spot an error in this? Specifically, the pBuf in the code loads 0 or null after a certain number of loops even though the file huge.
What sort of file are you reading. If it is an exe, dll etc. then it is highly likely you'll find lot's of 0's in the file. Or are you saying that iReadSize coming back with 0 before the end of the file?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi,
You're right. The number of bytes returned from reading is ZERO before end of file has been reached.
When I check the pBuf, it has loaded "" into it..more likely, it loads nothing in the buffer. That's why it returns ZERO bytes. But this works for text/wri files though.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Your thoughts on this will be very appreciated.
JJ
|
|
|
|
|
Merc wrote:
You're right. The number of bytes returned from reading is ZERO before end of file has been reached.
When I check the pBuf, it has loaded "" into it..more likely, it loads nothing in the buffer. That's why it returns ZERO bytes. But this works for text/wri files though.
Is this happening if you specify: CFile::typeBinary, because it shouldn't. Have you wrapped the Read in a try/catch block to see if an exception is being raised. This is what the VC++ docs suggest you do.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hmmm, I'll try the try/catch thing and keep you posted. Yes, I did specify typeBinary. I'll check the MSDN website where I hog 24/7 for info. You're the only one who understood the problem right, you know.
Thanks for the input...catch you soon.
JJ
|
|
|
|
|
I believe your process code is setting pBuf = 0 at some point. That's why you get the ASSERT.
Todd Smith
|
|
|
|
|
Hi Todd,
That's not the case though. The number of bytes returned from Read(pbuf, 4095) is zero after couple of loops. Just this is only a problem for txt/wri files.
Thanks if you can help.
jj
|
|
|
|