|
Hello All
I have a small DialogApp(mfc). when I compiled it with vc7, the exe runs fine on NT4, Win2k and XP, but when trying to run it on Win98, Win98 kept saying that the exe image is corrupted. I wonder if anyone've seen the problem and know why?
PS. mfc and CRT is statically linked into the exe.
|
|
|
|
|
normally its the other way round.. but 98 suxx indeed
Don't try it, just do it!
|
|
|
|
|
Are u compiling your program in Unicode ? if u are, then it will not run in legacy windows (WinME, Win98, Win95).
I Dream of Absolute Zero
|
|
|
|
|
Hey,
My prog is supposed to communicate with an external device with the serial port.I ve got some trouble trying to get it working...
If I don t run the hyperterminal before using my software, the communication doesn t work.I ve tried to use overlapped and nonoverlapped communication.I ve tried to use a couple of activex controls and different classes.But it's still the same.Moreover, I am almost sure that my initializiation parameters are OK.
Has somebody already had this kind of bug?
What does the hyperterminal do that my prog doesn t?
I tried to use a sniffer to find out what s going on in my communication, but everything looks find as well.
If you have any ideas, please feel free to share ur thought....
I ve been trying to debug my softare for 2 weeks now...
Thanks for ur precious help.
sysy
|
|
|
|
|
You can use PortMon[^] to compare the settings of the terminal program with those of your application.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Cable
If hyperteminal works then it should be OK
Data
You are using a sniffer, have you tried using 2 PCs with your prog on #1 and hypertermial on #2? Or use 1 PC with two serial ports?
CreateFile
CreateFile can be used to send serial data, search MSDN for "Configuring a Communications Resource" try this and send a test string to another PC that has hypertermial running, e.g. send "hello world". This should prove out your line settings baud rate, stop bits, parity etc. I assume this is where you problem is.
With serial comms I always found is easiest to buy a comms library, the last one I used was COMM-DRV.
Generally the problems are caused by the cable, handshaking, or not setting the DCB block in SetCommState
A favourite problem is using XON/XOFF protocol and sending XOFF, also some devices/computers will conver a LF to CR/LF unless line characteristics are set to raw mode.
So do a simple test to prove it works sending to hypertermial, that will elinate the receiving prog/device.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
Hi,
you can try to use the MSCOMM32.OCX for that.
Otherwise you can find a serial class here:
http://www.naughter.com
Regards Mark
|
|
|
|
|
Hi
When i load my workspace, i get a message "can not access the calss view information file. classview information will not be available". how can i fix this problem?
Thanks
|
|
|
|
|
is the class view empty?
yeah,when I link to the sourcesaft control, that is like you.
dupengfei
|
|
|
|
|
First, check if you have a hidden msdev.exe process running when no Visual Studio is running. If you have one, kill it. If that doesn't help, delete the classview file, .clw. It will be regenerated when you load and compile.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Please check the following link for the solution
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&mode=all&userid=161454&select=491032&df=100&fr=16230.5#xx491032xx
|
|
|
|
|
Hi all,
I am having problem to load BITMAP on a Custom Dialog.
Everything is ok, i mean.. from the main dialog, i clicked button A to launch the Custom Dialog.
Compiled, Run...works perfect..the Custom DIalog came out..
but the problem is how to load a BITMAP into and display on the custom dialog???
Its totally different compare to loading into the main dialog? (i know how to load into main dialog)..
My custom dialog do not have the OnInitDialog() and the OnPaint() function!!?!
So should i declare some new one?
so where should i put these codes??? put them in the main dialog header file or the custom dialog header file??
public:
CRect rectStaticClient;
int sourcex, sourcey,offsetx,offsety;
protected:
CDC m_dcMem; // Compatible Memory DC for dialog
HBITMAP m_hBmpOld; // Handle of old bitmap to save
HBITMAP m_hBmpNew; // Handle of new bitmap from file
BITMAP m_bmInfo; // Bitmap Information structure
also i suppose to put this into OnPaint()
CPaintDC dc(this);
dc.BitBlt(offsetx,offsety,m_size.cx,m_size.cy,
&m_dcMem, sourcex, sourcey,SRCCOPY);
CDialog::OnPaint();
but now..where should i put them?
also...all those member variables.. where should i declare them?
into the Main Dialog or into the Custom Dialog??
hope u guys can help and guide me.
thanks alot..
regards,
Thong
twh81@tm.net.my
...
|
|
|
|
|
Ok, i realise this might not be the right place to be asking this question so if you know of a forum where it might be right please direct me there..
Anyways, my question is this:
When a program links to a dll, for example the winsock dll, and calls functions from it, when i decompile that program, with lets say WDasm32, will i just see it call to a memory location to where the function is once windows mapped the dll in memory? Or how does this work? Or when i decompile it, does WDasm32 also decompile the parts of dll? I don't think so, but i don't know for sure.. I've never come accross a jmp or call that references to a memory location that doesn't exist in the file so.. This is pretty confusing to me. Maybe someone knows where i can find more info about this topic?
Kuniva
--------------------------------------------
|
|
|
|
|
The portable executable format (PE) has an export table in it which has an entry for every DLL function that is called. When you call a DLL function within your code, at compile time this calls a method in this export table - it does not call the DLL directly. When the executable is loaded into memory, the required DLLs are then loaded as well (except if delayed-loading is on), and at that point Windows updates the export table so that it refers to the loaded location of the functions within the DLL. The advantage of this approach is that each DLL function is only called from one location, making it very fast to perform this update. If an export table were not used, Windows would have to scan through the entire executable looking for references to the DLL to update.
Consequently this means that you won't come across a jump to a memory location that doesn't exist (due to a DLL function call), as within the assembly code they will be jumps to the export table instead.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
ah, this clarifies things a bit, thank you.
Kuniva
--------------------------------------------
|
|
|
|
|
can anybody tell me why i'm getting an access violation on the first "if hWnd != NULL
I'm trying to make sure resources get cleaned up when the destructor is called. trying not to use MFC because of mixed mode [CLR/Native] DLL issues
<br />
CPrefsDialog::~CPrefsDialog(void)<br />
{<br />
#ifdef _DEBUG<br />
char buffer[1024];<br />
if( hWnd != NULL )<br />
sprintf(buffer,"hWnd valid",hWnd);<br />
else<br />
sprintf(buffer,"hWnd is null");<br />
MessageBox(HWND_DESKTOP,buffer,"~CPrefsDialog",MB_OK);<br />
#endif<br />
<br />
if( hWnd != NULL ) <br />
{<br />
DestroyWindow(hWnd);<br />
hWnd = NULL;<br />
}<br />
}<br />
|
|
|
|
|
ENewton wrote:
sprintf(buffer,"hWnd valid",hWnd);
You either don't need the 3rd parameter or you need to include a %d in the 2nd parameter.
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
well... its actually failing just above the sprintf, during the test
if( hWnd != NULL )
^^^^^ its failing on the test... which is just crazy to me
|
|
|
|
|
The misteak is in the sprintf.
Trust me
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
ok i'll try it... will edit this post with results.
EDIT: ok just tried it... still no workie. took out the 3rd parameter on the sprintf, but its still breaking at the "if( hWnd... )" line.
Can anybody figure this one out? I'm stumped.
|
|
|
|
|
Has hWnd been set to null in the constructor? This should not cause your problem though.
Otherwise it looks like you have corrupted some memory location, possibly in this class, try cutting it down to be as small as possible, if possible just have the constructor and destructor, if that works keep adding bits of code, or bench check the source code.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
ENewton wrote:
CPrefsDialog::~CPrefsDialog(void)
Remove the void keyword from the parameter list. I don't think this is valid syntax for a destructor, which takes no arguments.
Software Zen: delete this;
|
|
|
|
|
Hi,
I have developed a graphics intensive application based on a MFC CView and GDI+. In order to quickly develop a good user interface for this application, I am considering the possibility of converting the application to operate as an ActiveX control and moving the UI development over to a RAD tool. The performance of the ActiveX control would be an important issue.
I have no experience of developing ActiveX controls, can somebody point me in a good direction to start? Also does anyone have any thoughts on this idea, could it possibly be a false economy?
Thanks in advance,
Rich
|
|
|
|
|
It may require some work. However, all this is implementable and straight forward: unless you are currently using an interface/callbacks from your View, that may not be or difficult to convert to Automation.
It's very important to start conversion with as minimum changes to your CView class. Therefore, i would recommend hosting your CView directly as a child of an ActiveX Control window (maybe even together with CFrameWnd).
I can't give you some published directions on that conversion, because I just don't know of them. However, I've done such several times.
If implemented properly, I don't think you will see any major performance hit due to ActiveX inproc COM calls.
As to could it possibly be a false economy: sure it could -- depends on your application, it's customer base, future of MFC/CLR.
I would say: if you have already implemented MFC portion: conversion to ActiveX is much simplier then writing from scratch either as ActiveX or WinForm.
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hello,
I need to retrieve the list of Domains, and or Workgroups available to my computer. Right now I can retrieve a list using NetServerEnum, with SV_DOMAIN_TYPE_ENUM, however this list is wrong as it retrieve the correct number of domains/workgroups but only the primary name is shown. The other is shown with a null entry for name.
After I have the correct list I can determine if its a domain or workgroup with NetVerifyName...I think.
After that, I can list the computers with NetServerEnum using SV_TYPE ALL.
So, my question is...how can I get the correct list of domains and workgroups available?
Thanks!
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|