|
In your resource file:
#define IDC_GRID 1004 In your header:
#include "GridCtrl_src/GridCtrl.h"
class CGridCtrlDemoDlg : public CDialog
{
public:
...
CGridCtrl m_Grid;
In your implementation file:
...
void CGridCtrlDemoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
...
DDX_Control(pDX, IDC_GRID, m_Grid);
}
...
BOOL CGridCtrlDemoDlg::OnInitDialog()
{
m_Grid.[SetSomeProperties...];
cheers,
Chris Maunder
|
|
|
|
|
Hi,
I have a doubt. How can I do to change the menu prompt at runtime ?
thanks.
|
|
|
|
|
menu prompt ?
the menu item text or the text that is displayed in the status bar when moving the mouse over a menu item ?
the first one is simple, use CMenu::ModifyMenu
the other things, I don't know .
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Hi,
Actually, I'm talking about the text that is displayed in the status bar when moving the mouse over the menu...
Can you help me ?
|
|
|
|
|
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.
|
|
|
|