|
Often that text is retreived from your accelerator table or string table (recources!).
the only thing you can do (as far as my knowledge go's) is harcode the tooltips...
good luck, I think you need it...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Dear Friends
As it is my first time to get a grip to commport, I've lots of problem with it, I used file operation method but it doesn't work properly, and notify by error 6 & 5.
I'd be appreciated if you could take a look at my code as bellow as advise me in this case
Regards
BOOL CMainFrame::InitSerialPort()
{
DCB dcb;
BOOL fSuccess;
char *pcCommPort = "COM1";
m_hComPort = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0, // comm devices must be opened w/exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);
if(m_hComPort == INVALID_HANDLE_VALUE)
{
// Handle the error.
CString str;
str.Format("CreateFile failed with error %d.\n", GetLastError());
AfxMessageBox(str);
return FALSE;
}
fSuccess = GetCommState(m_hComPort, &dcb);
if (!fSuccess)
{
// Handle the error.
AfxMessageBox("GetCommState failed with error %d.\n", GetLastError());
return FALSE;
}
dcb.BaudRate = CBR_9600; // set the baud rate
dcb.ByteSize = 8; // data size, xmit, and rcv
dcb.Parity = NOPARITY; // no parity bit
dcb.StopBits = ONESTOPBIT; // one stop bit
fSuccess = SetCommState(m_hComPort, &dcb);
if(!fSuccess) //////////// this line hs been repeated ////////
{
// Handle the error.
AfxMessageBox("SetCommState failed with error %d.\n", GetLastError());
return FALSE;
}
return TRUE;
}
//**************************************************************************************************
void CMainFrame::OnCommClose()
{
m_ComPortOpened = FALSE;
m_isRunning = FALSE;
|
|
|
|
|
soobot wrote:
AfxMessageBox("SetCommState failed with error %d.\n", GetLastError());
AfxMessageBox() does not do variable substitution.
|
|
|
|
|
replace all of MessageBox's with
CString str;
str.Format("CreateFile failed with error %d.\n", GetLastError());
AfxMessageBox(str);
Then repeat your problem in board message.
If u wanna give a fast conclusion your message should be in first page of the forum.
|
|
|
|
|
Hi,
I have scanned in graphs which are now available in bitmap format and I wanna programmatically convert its curves (i.e. significant points) to coordinates expressed in numbers.
Please give me advice.
Bunburry
|
|
|
|
|
Hello,
I want to change FONT from one type to another type. Courier to Arial for example. Which function can help me to do that?
Thanks a lot.
|
|
|
|
|
Actually, your question is quite ambiguous but with my sixth sense around I try to answer your question.
I assumed you are talking about DC painting or drawing in a formview or dialog. To change a font type, codes are as below and comments do the explanation.
<br />
CFont oFont;<br />
oFont.CreateFont(11, 6, 0, 0, FW_THIN, FALSE, FALSE, FALSE,DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_MODERN, "Arial");
<br />
CFont* oPreviousFont = (CFont*) pDC->SelectObject(&oFont);<br />
<br />
COLORREF colPreviousTextColor = pDC->GetTextColor();
pDC->SetTextColor(RGB(255,0,0));
<br />
RECT _rect;<br />
GetClientRect(&_rect);<br />
CRect oRect(_rect);<br />
pDC->DrawText("Hi, I am in Arial ",oRect,DT_RIGHT);
pDC->SetTextColor(colPreviousTextColor);
pDC->SelectObject(oPreviousFont);
Hope this helps.
|
|
|
|
|
How can I use the method loadfile for ADOBE ACROBAT CONTROL ACTIVEX
from ActiveX container Tester. I have tried to put full path to
specific .pdf file and set to VT_BSTR for parameter type. Seems
it doesn't do anything. anyone has same problem before and managed
to solve?
Thanks
Shin
|
|
|
|
|
I am making a timer program but I want it to stop at a certain number like 300. I made it so it counted but the timer wouldn't stop at a certain number i.e. 300.
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
|
if(m_iCount == '300')<br />
{<br />
KillTimer(ID_TIMER);<br />
m_cStart.EnableWindow(TRUE);<br />
}
I have this in my Start button but I just realized that, that place is not a
very good choice (YAY). But I still don't know were to put it.....
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
I figured this out see I had to include this in the wm_timer function or the OnTimer function, and had to change the statement to:
if(m_iCount == 300)<br />
{<br />
KillTimer(ID_TIMER);<br />
m_cStart.EnableWindow(TRUE);<br />
}
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
Thx though for the concern....
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
Hello,
do you know how to install the TCP/IP protocol programmatically? Normally you do this using the control panel but how to do it in a program?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Sorry, I don't know, but I'd like to know the answer to your signature
Grüße aus Deutschland
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Why don't you try it? ;)
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Unhandled exception at 0x00401002 in asmtest.exe: 0xC0000096: Privileged instruction.
No more, no less
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hmm, interesting
At least on 9x/Me it works
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
You can not communicate with ports in NT (4.0,2k,XP,2003,++). That is only done with a device driver..
John
|
|
|
|
|
Greg S. wrote:
Sorry, I don't know, but I'd like to know the answer to your signature
On older OSes and standard keyboards, this disable the keyboard.
But direct access to I/O ports is restricted to drivers on modern OSes.
You can see now why this is a good thing.
Acting as a substitute for God, he becomes a dispenser of justice. - Alexandre Dumas
|
|
|
|
|
thanks for the info!
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all,
I am trying to debug an MFC application. Dialog Based.
As soon as I reach a breakpoint, neither of my application or MSVC does respond anymore.
The funny thing is if I start my application outside of the IDE, and if an exception is raised then I can enter the debugger without any problem.
Is there anything I can check so that I can understand/fix what is going on ?
Thanks for any help.
Zindine
|
|
|
|
|
What OS are you using? I had that all the time on Win98 and ME. It was fine on Win95, and has been fine on XP. Any NT based OS should be fine. Make sure that you're using the latest service pack (at least SP5).
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hy Ryan,
My OS is Windows 2000 SP3.
How do I know for sure that MSVC 6.0 is updated with SP5 ?
I did apply it but my experience tells me that sometimes some of the files in system32 are overridden by applications.
Added to that, it does it only with that particular application. I did reset all the settings of my project.
I am a bit lost. Never seen that before in 5 years that I am using MSVC 6.0
Thanks for answering anyway.
Zindine
|
|
|
|
|
Yeah, sorry I can't help more. I don't have the problem on WinXP, that I use now, and I've never had 2k. It seems to be OS related though (in my experience), so you might want to check if there are any more SPs available for 2k. I'm not sure what the latest it.
Although, If it only does it for one application, it's wierd. Have you done a rebuild-all? Have you tried restarting the computer? Probably, but just thought I'd check
Others may have more they can say on this
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|