|
Some things to check for:
1) See if a Rebuild All (or a Clean-then-Build) will fix it. Sometimes incremental builds have issues that show up when linking.
2) Check the version of the libraries each of your libraries is using. That is, make sure that if you are using MFC (which it appears you are), all apps and libraries using MFC have the "Using MFC" selection checked in your Project Settings. Also, check the code generation to make sure they are all using the same type of threading library (linking a library that uses a single-threaded library to an app that uses the multi-threaded library gives weird linking errors).
3) Finally, if neither of those worked, try comparing each and every setting between your Debug and Release build configurations. Try copying all the debug settings over to your release build and slowly undoing them 1-by-1 to find which setting is causing the differences.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi,
I'm migrating a project from VS 2003 to VS 2005. As always, exporting templates (instantiations of them) is a hard work. The problem is that I'm exporting an std::iterator implementation and, to avoid warnings, I have to export also its base classes, for example: _Iterator_base. The problem is that in release, this is a struct, and in debug this is a class!!! Do you know if there's a workaround other than doing another #ifdef...??
I'll really appreciate any clue!
Thanks in advance,
Federico
|
|
|
|
|
I have a dialog box that I would like to increse a variable everytime a button is pushed, but instead once the button is pushed the variable is set to 2376868 everytime. Using message boxes to debug a little I determined that the variable seems to randomly increse in the WM_COMMAND part of my message loop. My dialog procedure looks something like:
BOOL CALLBACK dlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int number;
switch (msg)
{
case WM_INITDIALOG:
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_REGISTER:
number += 1;
EndDialog(hwnd, 0);
break;
}
break;
case WM_CLOSE:
EndDialog(hwnd, 0);
break;
default:
return FALSE;
}
return TRUE;
}
Any thoughts on how to fix this? Thanks
-Matt
|
|
|
|
|
number has not been initialized.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
case WM_INITDIALOG:
number isn't initialized but the value is stored from an INI file within WM_INITDIALOG
|
|
|
|
|
Then you must change it from auto to static .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You number variable is a non-static local one (in addition, it is not initialized), therefore its value will be lost after you exit the dialog procedure.
If you need it only within the function, declare it as static, and initialize:
BOOL CALLBACK dlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int number = 0;
...
}
If you need it outside, then move it on file level.
|
|
|
|
|
making it a static variable fixed the problem...thanks a lot!
|
|
|
|
|
how the datetime picker store date
as edit box can store SetDlgItemText()
Please mail me
|
|
|
|
|
yogendra kaushik wrote: how the datetime picker store date
Use CDateTimeCtrl::SetTime() , or if you are not using MFC, send the control a DTM_SETSYSTEMTIME message.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i develop one application in VC++-MFC 6.0 ,
this application is responsible for inserting image into the database (oracle)-ODBC.
but when i try to insert a image file , it through a error like
"Data type conversion error."
////////////////////////////////////////////////////////////////////////
CDaoDatabse db;
CDaoRecordset recset(&db);
void CDBODBC::InsertintoDB();
{
CByteArray BlobFile;
BlobFile.RemoveAll(); // I clear the Array
CFile aFile("image.jpg",CFile::modeRead);
BlobFile.SetSize(aFile.GetLength());
aFile.Read(BlobFile.GetData(),aFile.GetLength());
aFile.Close();
COleVariant aVar(BlobFile);
CString Sql = "SELECT * FROM sample3";
db.Open("abc",FALSE,FALSE,"ODBC;UID=abcWD=abc;DSN=abc;");
recset.Open(AFX_DAO_USE_DEFAULT_TYPE,Sql,dbAppendOnly);
// bool b=recset.CanUpdate();
recset.AddNew();
recset.SetFieldValue("[num]","6"); //varchar field
recset.SetFieldValue("[photo]",aVar); //BLOB field -image field
recset.Update();
recset.Close();
db.Close();
}
/////////////////////////////////////
it works for Access database ..
but i got error in oracle...
"Data type conversion error."
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
See if this helps.
maharaja pandian wrote:
CDaoRecordset recset(&db);
In addition, if you would derive a class from CDaoRecordset , the RFX_Binary() code would handle the details for you.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tnx for ur reply,
but COleVariant is used to store the "OLE object" datatype in .MDB database.
when i use oracle DB , the corresponding BLOB datatype is not get matched with COleVariant class in VC++.
I got the error like " Data type conversion error"
can u please send the details to store the oracle BLOB value
throuh VC++.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
|
tnx for ur reply,
but COleVariant is used to store the "OLE object" datatype in .MDB database.
when i use oracle DB , the corresponding BLOB datatype is not get matched with COleVariant class in VC++.
I got the error like " Data type conversion error"
can u please send the details to store the oracle BLOB value
throuh VC++.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
--------------------------------------------------------------------------------
I have an HBITMAP. From that I construct a CBitMap obj and Using GetBitMapBits, get the Byte info into a byte array. I also fill up the BITMAPFILEHEADER and BITMAPINFOHEADER. Then i first write the BITMAPFILEHEADER, then the BITMAPINFOHEADER and then the BYte Array of the bitmap into a .bmp file. My bmp comes up but its upside down. I.e the generated .bmp is upside down of the original image. Where am i mistaken?
Reji Kumar,
Software Engineer,
India.
|
|
|
|
|
Perhaps, instead of obsolete GetBitmapBits , you should use ::GetDIBits ? Compare you writing procedure with this one[^].
|
|
|
|
|
|
Hi all,
Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window.
But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window
i'm not able to figure out the reason y itz not showing up.It'll be really great if someone can help me out in this.
Thanks in advance,
rajeev
|
|
|
|
|
When you create the control with Create , be sure the WS_VISIBLE window style is specified, for instance:
myStatic.Create("Test", WS_BORDER | WS_VISIBLE, CRect(30,30,100,100), this, 12345);
|
|
|
|
|
well all those properties have been set properly but still i'm not able to get it right..
-- modified at 9:55 Friday 9th June, 2006
|
|
|
|
|
Is your variable for static control defined as a class member, or as a local variable in CMainFrame::OnCreate ?
In order to work, you have to have a line like CMyStatic mMyStatic; within frame class declaration (in *.h file), and a line like mMyStatic.Create(...) somewhere at the end of CMainFrame::OnCreate function. Where are you creating the control?
|
|
|
|
|
What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
its an SDI application....
the code i've used is
CLed m_led; ///declared in mainframe.h
m_led.Create(...);// in the OnCretae of mainframe.cpp
here CLed is a class derived from CStatic which gives some special features to a static control...
|
|
|
|
|
Did you read and tried the solution that people gave you ? I'm almost sure that Viorel got the point. Did you tried it ?
Cédric Moonen
Software developer
Charting control
|
|
|
|