|
- you cannot debug MSVCRT
- BoundsChecker is not always accurate. Far from that, type casting makes it easily confused and say wrong things about it. Moreover, you are not telling us whether BoundsChecker reports it is a object leak, interface leak, gdi leak.... If that's an object leak, then MSDEV is likely to show it as well (as a proof whether BoundsChecker is wrong or not).
- Best advice would be :
-- do not use DNSAPI if you can
-- try to use it in another similar program
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.
|
|
|
|
|
Wish I could not use DNSAPI, but one of the requirements that I have already is that I can resolve an Internet Address by name as well as by numbers, so I have to use it.
I sort of realized that boundschecker is not going to be completely accurate. Many people have posted examples of the way I use gethostbyname, so I will check out one of their programs to see if it is the same problem. Otherwise it must be the way I am using it.
As far as the leak goes... It is labeled as a memory leak. VC++ doesn't record the leak, which is where I normally start. I usually use Boundschecker if I have had a problem that might be memory related. I have learned to ignore resource leaks and gdi leaks unless they are in my code.
Thanks for the help though. I appreciate the feedback...
|
|
|
|
|
Hi all
First off, I know nothin of C++ (well i can read a bit). Now the problem is: I have a static object library (file.lib) and its header (file.h). Now I want to compile this into a static(???) DLL and export the 4 functions available in the header. Is this possible?
I have tried something myself by creating a file.c file and including file.h at the top. I also made a def file with the exports (correct AFAIK) and adding file.lib to additional dependacies in the linker properties. This is why I like C# so much, VC++ has toooo many settings!
Can someone please help? I'm clueless!
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie,
I see you are creating a .def file, are you trying to convert this into a .dll that can be called from VB?
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Nick Parker wrote:
I see you are creating a .def file, are you trying to convert this into a .dll that can be called from VB?
C# really, but yes!
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie wrote:
First off, I know nothin of C++ (well i can read a bit). Now the problem is: I have a static object library (file.lib) and its header (file.h). Now I want to compile this into a static(???) DLL and export the 4 functions available in the header. Is this possible?
Yes.
Let the wizard generate a DLL project for you. I prefer to use (MS specific) __declspec keywords instead of a DEF file.
Pavel
Sonork 100.15206
|
|
|
|
|
Pavel Klocek wrote:
Let the wizard generate a DLL project for you. I prefer to use (MS specific) __declspec keywords instead of a DEF file.
OK I rephrase, I know nothing of Visual C++
What wizard must I use? what is this precomopiled header, do I need it? I dont really want answers to these. I just too much for me, but the compiler complains to what ever I do, so I just remove them.
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie wrote:
What wizard must I use?
AppWizard "Win32 Dynamic-link library" in VC6, should be in VC7 too. It generates a dummy DLL project with some optional example code.
leppie wrote:
what is this precomopiled header, do I need it?
No, you don't need them, if you turn of use of precompiled header files in your project settings (C/C++ section). The purpose of precompiled headers is to speed up the compiling - selected header files are compiled only once per project, otherwise they are compiled with every cpp file where included again. The stdafx.h file marks a point, where the precompiled headers ends in your cpp file, following includes are compiled as usually.
Pavel
Sonork 100.15206
|
|
|
|
|
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 ) ;
|
|
|
|