|
The application now works but some of the data is wrong in Release mode but everthing works fine in Debug. How do I compare the two and see where it went wrong? Thanks!
|
|
|
|
|
elephantstar wrote:
The application now works...
What did you change to correct the behavior?
elephantstar wrote:
How do I compare the two and see where it went wrong?
The two what? Are you talking about the project's .dsp file?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Instead of including <afxpriv.h> within stdafx.h, I included it directly with the class. Previously, my class included stdafx.h which in turn included <afxpriv.h> and it worked just fine.
As for my changes that causes two different outputs in Debug and Release mode, I didn't think to check in Release mode each time I updated my application. I have been using debug mode up until I needed to release it. Only then did I find out too late that it did not produce the correct output.
Is there an easy way to compare the two configurations and see where the problem lies?
Thanks!
|
|
|
|
|
elephantstar wrote:
Is there an easy way to compare the two configurations and see where the problem lies?
Yes. Look at the project's .dsp file. Haven't I mentioned that before?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes you did but I wasn't sure what I was looking at. Am I looking for differences in the two configuration settings? Thanks!
|
|
|
|
|
elephantstar wrote:
Yes you did but I wasn't sure what I was looking at.
The release-specific settings will follow !IF "$(CFG)" == "prjname - Win32 Release" and the debug-specific settings will follow !ELSEIF "$(CFG)" == "prjname - Win32 Debug". Look at the lines in each section and will become apparent what you are supposed to compare.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I remember seeing somewhere there was a way to use AfxBeginThread with a non-static member function. Does anyone out there know anything about this?
[insert witty comment here]
bdiamond
|
|
|
|
|
Is this of academic interest? Otherwise you could just send the this-pointer as pParam in the call, using a static member function as thread func. In that function, just convert the argument and call whatever non-static member you'd like.
|
|
|
|
|
Thanks, actually I just tried that. It works, except for some other problems I'm having.
[insert witty comment here]
bdiamond
|
|
|
|
|
I'm trying to program an application which is supposed to write several strings in .txt files. But no matter what i do, it keeps writing each string over the last one written, so i never have more than 1, and not even properly written if its shorter than the one before
I'm using WriteString(), and before was using Write().
How can i do to write in the same file after closing it without this problem?
Thank you very much.
|
|
|
|
|
Use the CFile::modeNoTruncate flag when opening the file. You'll then need to call CFile:SeekToEnd() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I AM CREATING AN APPLICATION IN WHICH I NEED TO CREATE A DIALOGBOX WHOSE SHAPE IS IN FORM OF A GIVEN PNG IMAGE.FEEL JUST LIKE SKINS PROVIDED IN WINAMP. IF ANY BODY CAN
|
|
|
|
|
Firstly could you please not use all capitals when posting messages.
See The RGN Generator[^] it will give you non-rectangular dialog boxes.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thx for this.The code given in this is not for the application shown.I couldnt get weather this is a animated gif or png.If anybody can provide its code
Thx
|
|
|
|
|
CAN ANY BODY TELL ME THE BEST SITE WHERE I CAN GET BRAINDUMPS FOR VC++ EXAMS.IS THERE ANY EXAM FOR VC++.NET RIGHT NOW WHEN IS IT LAUNCHING
|
|
|
|
|
How about brainbench.com?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi all
I had a problem with MFC CSocket class.I use VisalStudio.Net
and corresponding MFC librarys from one.
My .exe application use an COM server which used this CSocket class.This pseudocode demonstrate what i try to do:
/////////////////Snippet from exe app////////////////
....
///pMySock is COM interface from my MySock.dll library
pMySock->Connect(...)
....
////////////////Snippet from MySock.dll library///////
class ATL_NO_VTABLE CMySock
{
....
CMySock::Connect(...)
{
if (m_sock.m_hSocket == INVALID_SOCKET)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//Just try to create syncronous socket
//but failed here in Win98,see following
m_sock.Create()
....
}
}
CSocket m_sock;
}
Also in InitInstance method i invoke AfxInitSocket()
function and rather use MFC static linkage.
This code work fine in Win2000 system, but then i launch same application in Win98 m_sock.Create() failed.
And i can't catch why it happens.
Please any suggestions
THANK
|
|
|
|
|
This can be down to the following registry being corrupt
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock2
See Related article[^]
It explains how to sort this out.
Hope this helps
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hello,
I just started using VC++ and developing a simple udp server application which uses listbox to show the incoming messages.
I am having trouble finding out if :
1. a new thread should be spawned to receive messages by the udp server (the received messages are to be displayed in the listbox)
2. or a different class should be created for the server
3. or the main dialog class can contain a function to invoke receive by server.
4. will this application require postmessage and getmessage functions: i mean a simple recieved message can be updated in the listbox window or not?
Also, if I want the application to start accepting the udp messages without any starting event (such as 'press start button'), where should the server code begin?
Any help will be highly appreciated. Thanks in advance.
|
|
|
|
|
Given the HWND of a dialog, is it possible to determine if the dialog is modal or not?
Using MFC, I could get the dialog's parent and see if it was disabled or not (due to the way MFC implements modal dialogs), but that will fail if [1] there is no parent or [2] if someone broke the "modal chain" by popping up another modal dialog from another window lower in the hierarchy/Z-Order.
Does anyone know if there is a way to do this? Assume that I have no internal knowledge of the dialog other than having access to its HWND .
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Hey James. I don't have an answer for you, but your question has got me thinking about it and frankly I'm stumped. If you ever do get a satisfactory answer could you possibly share it here, as an article perhaps?
An idea I had was using the CDialog::m_nFlags member and checking for the WF_MODALLOOP and WF_CONTINUEMODAL flags. But that is MFC only, and the flags did not seem to be consistant between modal and modeless dialogs.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Is there anybody out there still using Visual C++ 5.) ?
I am looking for a possibility to draw animated GIF in my application. On CP there are some examples, but they are all for VC6. I do have a CPicture class which can draw BMP, JPG and GIF, but when I try to import an animated GIF in my resources, developer studio says it is not a valid GIF file. When I open this file in an explorer window I see the animated picture.
Can anyone help?
|
|
|
|
|
is there anyway i can find out the height and width of the title bar? (i noticed the sizes changed from Windows Classic mode to Windows XP mode)
|
|
|
|
|
I think what you are wanting is GetSystemMetrics(SM_CYCAPTION) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I used Shell_NotifyIcon to minimize the application to the nofitication area (system tray) and put an icon there. When the minimize button of the system menu is pressed, the dialog is minimized to the system tray. It was working perfectly until I tried to put an option in the title bar menu, which gave the possibility to choose whether or not to start the application as minimized. I save this information in a file, and read from the file on initialization.
The problem is that the application starts as minimized, but the main dialog can never be displayed when the Menu->Open is clicked from the tray menu. I guess it is restored to the previous position, and the previous position was "minimized".
Does anyone know how to overcome this problem?
Thanks in advance...
PS: my dialog is of fixed size.
CMyDialog::OnInitDialog()
{
...
if(startOnTray)
{
SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_HIDEWINDOW);
this->Minimize2NotifArea();
}
else
SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
return TRUE;
}
CMyDialog::OnMenuOpen()
{
Shell_NotifyIcon(...);
this->ShowWindow(SW_RESTORE);
}
|
|
|
|