|
Hi,
I use the function ShellExecute to open a PDF-file from my c++-programm (ActiveXControl). I want to highlight one word on the pdf-file. Can I do this with ShellExecute or have you another idea how I can realize that.
Julia
|
|
|
|
|
In my SDI application , I have a ToolBar with 10 buttons .
I am unable to Change the text displayed in this Button .
I named the button ID_NEWBUTTON and have a event handler in CMainFrame.
I tried to change the text in the Toolbar button using
m_wndToolBar.SetButtonText(m_wndToolBar.CommandToIndex(ID_NEWBUTTON),"Please change text");
Still nothing seems to be happenning ?
|
|
|
|
|
How can I programatically change the Color of a ToolBar ?
|
|
|
|
|
Hi,
try this
<br />
SetClassLong(m_wndToolBar.m_hWnd, GCL_HBRBACKGROUND, (LONG)::GetStockObject(WHITE_BRUSH));<br />
Regards
|
|
|
|
|
I have an SDI framework where my Chidlview creates many Dialogs within itself .
I want to trap a keyboard entry in one of the dialogs . For this I went to ClassView and added the event Handler with a dummy AfxMessageBox
This event is not getting fired ? Suggestions are needed .
|
|
|
|
|
Hello,
Where did you add the event handler? The OnChar() handler should be added to the dialog in which you want to trap a keyboard entry!
hope this helps a bit...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Sorry the subject was hard to summerize.
I have created a function that I thought was type independent, meaning that it didn't matter what type of an array was passed to the function. It would just write the data with a comma seperation.
I have 2 structure in a class called RFMAccess:
struct TSimHeader
{
char Name[47][21];
char Unit[47][21];
double Min[47];
double Max[47];
int SignalCount;
int SimStatus;
}static TSimHeader_arr[10];
struct TSimSignal
{
double Value[47];
double TimeStamp;
}static TSimSignal_arr[10];
The data in these structures gets updated 2x a second.
I also want to write the data to a file 2x a second so, I created a function that I thought would do this without having to declare the array type. I want to be able to use this later in other projects.
Here is my function.
I am doing something incorrect here, but just not sure what it is.
ofstream fout ("test.txt");
bool firstTime = true;
int passes = 1;
void LogData::writeData(void *data){
int count;
if(firstTime){
fout<<"flight_data,";
for(int i=0; i<RFMAccess::TSimHeader_arr[0].SignalCount; i++){
if(i == 0){
fout<<data[i]<<endl;
passes++;
if(passes == 2)
writeData(RFMAccess::TSimHeader_arr[0].Unit);
else if(passes == 3)
writeData(RFMAccess::TSimHeader_arr[0].Min);
else if(passes == 4)
writeData(RFMAccess::TSimHeader_arr[0].Max);
else if(passes == 5){
firstTime = false;
writeData(RFMAccess::TSimSignal_arr[0].Value);
}
}
else
fout<<data[i]<<",";
}
}
if(!firstTime &&(flight_data->log == true)){
if(i == 0){
fout<<data[i]<<endl;
writeData(RFMAccess::TSimSignal_arr[0].Value);
}
else
fout<<data[i]<<",";
}
}
Thnaks for the help,
Steven
|
|
|
|
|
What is the actual problem your getting?
Regards,
Brian Dela
|
|
|
|
|
It's saying that the type of void is unknown or zero.
thanks
steven
|
|
|
|
|
Anyone have a link to a good resource explaining how to use CDialogBar ?
|
|
|
|
|
Hi, all
I am experiencing a problem, when I change an edit box into readonly/lock state the backgroundcolor of control changes into the buttonface system color. How can I prevent this or choose a different color?
Thanks in advance
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
u have to trap the OnCtlColor() event but as i recall edit boxes dont play nice and repaint themselves in a few places so it can be a bit of a b*itch
"penguins have no bill" biz stuff about me
|
|
|
|
|
return a White Brush in OnCtlColor()
|
|
|
|
|
Ok, Thanks mates
I will try that out
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
This is the default windows behavior. Unless it is absolutly necissary I would not change it because it will confuse your users who will expect to be able to edit the box.
John
|
|
|
|
|
Hey! I'm trying to get a child dialog to show up in a pure Win32 app.
What I want to do is use the dialog as half of the UI and use a simple ListBox (created with CreateWindowEx) as the other half.
Here's what I'm trying:
hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, (DLGPROC)DlgGameInfo );
The line of code works for all non-child dialogs (like my About and Options dialogs), however as soon as I specify in the resource editor that my IDD_GAMEINFO should be a child it doesn't work.
Any help is appreciated! Thanks
./[tiller]
|
|
|
|
|
|
The hWnd is the HWND variable that the main window's WndProc message handler recieves.
In the switch statement for the various windows messages I basically have the following to create my UI:
case WM_CREATE:
HWND hCtrls;
// Listbox works
hCtrls = CreateWindowEx( WS_EX_CLIENTEDGE, "LISTBOX", "",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL,
5, 5, 200, 340, hWnd, (HMENU)IDC_GAMELISTBOX,
GetModuleHandle(NULL), NULL);
// Static frame works
hCtrls = CreateWindowEx( WS_EX_CLIENTEDGE, "STATIC", "",
WS_CHILD | ~WS_VISIBLE | SS_GRAYFRAME,
210, 5, 250, 340, hWnd, (HMENU)IDC_GAMEINFOFRAME,
GetModuleHandle(NULL), NULL);
// CreateDialog returns a NULL (IDD_GAMEINFO is my dialog resource)
hCtrls = CreateDialog( hInst, (LPCTSTR)IDD_GAMEINFO, hWnd,
(DLGPROC)DlgGameInfo );
// I also added this later to try it...but it didn't help:
ShowWindow( hCtrls, SW_SHOWNORMAL );
UpdateWindow( hCtrls );
I experimented a bit...the code with no modification works if I specify in the resource editor that the dialog is a regular popup with a border, etc. But of course then it's a popup...and I want it a part of the actually window. (Like a common control would be)
Thanks,
./[tiller]
|
|
|
|
|
Not sure that this is your case, but for child dialogs you have to ensure that the WS_VISIBLE style attribute is set in the resource.
|
|
|
|
|
Yeah...I have WS_VISIBLE selected.
./[tiller]
|
|
|
|
|
I have a member variable of a class declared as a pointer to type double, m_dHessianMatrix . This variable will be holding a 2 x 2 matrix (could be larger)and needs to be initialized completely to zeroes to start. As such, I need something to init the matrix to zero quickly (thus a for loop will not do particularly for LARGE matrices).
Currently I am initializing the matrix data in the constructor as follows:
CROT_Optimizer::CROT_Optimizer(UINT MaxNodes)
{
ASSERT (MaxNodes > 0);
if (MaxNodes == 0)
return;
m_uiNumberOfNodes = MaxNodes;
m_uiNumberOfSprings = 0;
m_ppNodeIndexedSpringArray = NULL;
m_dHessianMatrix = NULL;
m_dHessianMatrix = new double[4];
memset(m_dHessianMatrix, 0, sizeof(double));
}
However, I don't like this for two reasons.
1.) I have to include string.h to gain access to the memset function ->code bloat
2.) It is not aesthetically pleasing to the eye
Is there a way to initialize the matrix without using a for loop and without using memset() ?
|
|
|
|
|
|
Ah, ok. One question.
If I have a 4 element matrix, is the proper syntax:
ZeroMemory(&m_dHessianMatrix, sizeof(double));
<pre><code>
ZeroMemory(&m_dHessianMatrix, 4*sizeof(double));
?
(Thanks for the suggestion)
|
|
|
|
|
ZeroMemory(&m_dHessianMatrix, 4*sizeof(double));
John
|
|
|
|
|
What functions/classes should I use for thread syncronization inside a module that is used in both ATL and MFC projects?
-Alma-
|
|
|
|