|
Long time ago someone showed me how to set up the release version so it can be debugged just like the debug version. But I dont remember it...???
Appreciate your help,
ns
|
|
|
|
|
in project / settings / C/C++ / general, change "debug info" to C7 or program database.
in project / settings / C/C++ / general, set optimizations to "disable(debug)".
in project / settings / link, check the box that says "generate debug info"
-c
Zzzzz...
|
|
|
|
|
A million thanks!!!
Appreciate your help,
ns
|
|
|
|
|
my program prints out a form with lots of text on it, and the last thing it prints is a line of text in a different font.. on every machine but one this works fine. that machine prints to the printer with everything in the same font, but it displays it on the screen with the correct font. i can print to this printer from my machine and it prints fine.
here is my code, is there any chance this is my fault, and not a problem with the printer driver? thanks for any suggestions!
for (int i = 0; i < m_oaText->GetSize(); i++)
{
CTextPrintObject* pOrigObj = (CTextPrintObject*)m_oaText->GetAt(i);
CTextPrintObject* pObj = GetScaleTruncTextOffset(pOrigObj);
if (pObj->m_nPage == m_nPagePrinting - 1)
{
UINT uOldAlign = pDC->SetTextAlign((pObj->m_nAlignment == 1) ? TA_RIGHT : TA_LEFT | TA_TOP | TA_NOUPDATECP);
if (pObj->m_strIDENT == "C_SCANLINE")
{
if (!fnBig.CreatePointFont(pObj->m_nSize,"OCR-A",pDC))
AfxMessageBox("Unsucessful in creating the OCR-A font");
}
else
fnBig.CreatePointFont(pObj->m_nSize,"Courier New",pDC);
CFont* pOldFont = pDC->SelectObject(&fnBig);
double dPosX = (2 + pObj->m_nPosX) * 1.003;
int nPosX = CFPCF::_round(dPosX * 10);
int nPosY = CFPCF::_round(pObj->m_nPosY * 10);
int nOffsetX = CFPCF::_round((pApp->m_dPrintOffsetX + DEF_PRINT_OFFSET_X) * 1000);
int nOffsetY = CFPCF::_round((pApp->m_dPrintOffsetY + DEF_PRINT_OFFSET_Y) * -1000);
pDC->TextOut(nPosX + nOffsetX, nPosY + nOffsetY, pObj->m_strText);
pDC->SelectObject(pOldFont);
pDC->SetTextAlign(uOldAlign);
fnBig.DeleteObject();
}
delete pObj;
}
also, this same machine when printing screws up my rotated text which I'm doing elsewhere, it completely screws up the rotation and the sizing.
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
One possible reason is that the printer driver has been setup to let the printer generate the printed image. If this is the case, you can only get the fonts/output correctly if the printer can actually generate that output. Check the printer driver settings and see if it can be configured to get windows to generate the image and send that to the printer.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
From MSDN:
CMenu* mmenu = GetMenu();
int pos = FindMenuItem(mmenu, "&File");
if (pos == -1)
return;
Here I want to append a submenu under "File". THere are no existing submenu items...
<code> CMenu* submenu = mmenu->GetSubMenu(pos);
pos = FindMenuItem(submenu, "&New\tCtrl+N");
if (pos > -1)
submenu->RemoveMenu(pos, MF_BYPOSITION);</code>
THe code in red is not what I want to do . I want to add stuff under "File" presuming it starts with nothing under it. Or do I resort to the cheap trick of putting in a submenu item with Resource editor, and then doing a removemenu on it? ANd then appendmenu my stuff?
Basically code> CMenu* submenu = mmenu->GetSubMenu(pos); - will this give me a pointer even if I dont have a submenu at all yet?
Appreciate your help,
ns
|
|
|
|
|
Or do I resort to the cheap trick of putting in a submenu item with Resource editor, and then doing a removemenu on it?
Start with an empty submemu (this won't show up if there are no subitmes, so the trick is neat), and (programmatically) add items to it. No need to remove anyhing.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hmmmm...crashed with an empty pointer "submenu" when I did: (all i have is a toplevel menu). Pos comes out correct
void CMainFrame::OnMakemenu()
{
CMenu* mmenu = GetMenu();
int pos = FindMenuItem(mmenu, "test dyn");
if (pos == -1)
return;
CMenu* submenu = mmenu->GetSubMenu(pos);
submenu->AppendMenu(MF_STRING, 0, "Dog");
}
int CMainFrame::FindMenuItem(CMenu *Menu, LPCTSTR MenuString)
{
ASSERT(Menu);
ASSERT(::IsMenu(Menu->GetSafeHmenu()));
int count = Menu->GetMenuItemCount();
for (int i = 0; i < count; i++)
{
CString str;
if (Menu->GetMenuString(i, str, MF_BYPOSITION) &&
(strcmp(str, MenuString) == 0))
return i;
}
return -1;
}
Appreciate your help,
ns
|
|
|
|
|
You're right, I've just tested and my assumption doesn't work.
Well the solution then will require some extra work: after locating the
File item, if the popupmenu is empty then you'll need to create a new popup menu
(remember to hold it as a member of your window) and append at its right location like this:
submenu.CreatePopupMenu();
submenu.AppendMenu(MF_STRING, ID_APP_EXIT, (LPCTSTR)"E&xit");
mmenu->ModifyMenu(pos,MF_BYPOSITION|MF_POPUP,(int)(submenu.m_hMenu),"&File");
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hey Joaquin! Thank you so much for all the hard work on my behalf! I like your solution better...I was adding a fake item from the resource editor and doing a remove or deletemenu on it...
I guess your method is a little different from what I found: (no CreatePopupMenu)
void CMainFrame::OnMakemenu()
{
CMenu* mmenu = GetMenu();
int pos = FindMenuItem(mmenu, "test dyn");
if (pos == -1)
return;
CMenu* submenu = mmenu->GetSubMenu(pos);
pos = FindMenuItem(submenu, "junk");
if (pos > -1)
submenu->RemoveMenu(pos, MF_BYPOSITION);
submenu->AppendMenu(MF_STRING, 0, "Dog");
}
int CMainFrame::FindMenuItem(CMenu *Menu, LPCTSTR MenuString)
{
ASSERT(Menu);
ASSERT(::IsMenu(Menu->GetSafeHmenu()));
int count = Menu->GetMenuItemCount();
for (int i = 0; i < count; i++)
{
CString str;
if (Menu->GetMenuString(i, str, MF_BYPOSITION) &&
(strcmp(str, MenuString) == 0))
return i;
}
return -1;
}
MAny many thanks!!!!
Appreciate your help,
ns
|
|
|
|
|
You are welcome
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Gosh!!!! Today I realized the power of your resolution in this post> Yesterday I wasnt understanding it! It has enabled me to create my popup menu flyout!!!!!
I cant thank you enough. I am so glad I saw the meaning of your resolution this morning since it didnt sink in yesterday.
Appreciate your help,
ns
|
|
|
|
|
hello,
i'm having a little trouble reading data from a cdrom. i have an application
which records cds with the help of a 3rd party product. i insert a blank
cd, record and want to verify the data afterwards with the directory, and
do not want to read the iso from disc again. but the windows directory is
not refreshed after recording. i do not want to enable autoinsertnotification
because of possible recording errors. and i do not want to eject and load the
disc after recording. another problem is that the system remembers the directory
even if i eject the disc and put in another blank one. then i read the directory
and files and it works in the beginning until a read error occurres.
is there any possibility to trigger a "manual" insert notification, or to
clear the cd cache? or am i doing anything wrong?
thanks,
enrico
|
|
|
|
|
some burners (including mine) will never recognize a burned disk until the drive is ejected and closed, it wont beleive there is anything on the disk until then.. my nero burning program opens and closes my drive before doing any verification..
hope that helps.. if not, good luck!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hello,
I have to burn 6 CD's and I've noticed that the program that's lauched as autorun needs this DLL MFC42D.DLL can I supply this DLL with the CD without being illegal?
Thank you in advance.
|
|
|
|
|
Can't you compile statically?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Console app that uses MFC...
not statically compilable, but as I've seen if I select the release debug the problem disappears... maybe because it compiles statically?
OK... better if this has been solved so easily...
Thank you for your interest.
|
|
|
|
|
Watch out! Maybe the target machine already has that DLL installed. You should check whether the thing works in a clean machine with no VC DLLs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I was about to burn a DROM with a simple app that launches a web page (simplifying is an executable that has a call to ShellExecute(...) that loads a web page).
The fact is that before doing it I've tried to run the exe file in the CD Burner PC and there (as there's no VC +6 installed the app has not worked...)
Now, after the compilation in the release mode the program has worked fine in the same computer...
this seems that will work fine...
Do I need to check something else?
Thank you for your interest again.
|
|
|
|
|
Do I need to check something else?
Yes, search for MFC42.DLL under the windows directory. The DLL could be there as a result of the installation of some other program. If so, (temporarily) remove it and try again.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
OK... I've found that DLL there...
but it seems that I can't delete/move/rename it...
I've used the dependency walker and it tells me that the MFC42.DLL the MSVCRT.DLL and the MSVCP60.DLL are needed...
Even if I delete it it seems obvious that it will fail then because of the fact that the dll's are needed.
As the DLL's seems to be needed then can I deploy them with my CD-ROM?
Thank you again...
|
|
|
|
|
Somewhere in your VC6 installation is a "redist.txt" file. It is a list of files you can distribute.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Now I was taking a look at it...
I've been searching at the MSDN too and there I've found the path of that file...
Thank you too.
|
|
|
|
|
No, you cannot legally distribute debug libraries (IIRC not even debug builds)
Changing requirements are the crux of software development - you start with a sex drugs and rock'n'roll design, and end up with an aids crack and techno implementation [sighist] [Agile Programming] [doxygen]
|
|
|
|
|
wow!
thank you! who would imagine that a debug build could not be delivered...
thank you again...
|
|
|
|