|
Actually, all I needed to do was move my code into the OnInitialUpdate function. I didn't need to call create!
void CSacmanSetupApplicationView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
CRect treeRect;
CImageList *pImageList=new CImageList;
My object is fine at this point
if(this->m_ctrlSetupTree)
{
Beep(999,99);
int i, icons=0;
for (icons=0; RCanalTree::m_icons[icons]; icons++) {}
pImageList->Create(16, 16, TRUE, icons,6);
for (i=0; RCanalTree::m_icons[i]; i++)
{
pImageList->Add(AfxGetApp()->LoadIcon(RCanalTree::m_icons[i]));
}
m_ctrlSetupTree.SetImageList(pImageList,TVSIL_NORMAL);
Had to make sure it was displaying an object with data in it..
m_ctrlSetupTree.SetCanalManagerPointer(this->m_oCanalManager.GetCanalManager());
Thanks for the help!
|
|
|
|
|
hello
i have a problem with "glutInit (&argc, argv)" it's an API of "glut" lib ,and
my problem are with the 2 parameter of glutInit ;i have made an MFC application and
i use glutInit ,like this :
void initializeGraphics (int argc, char **argv)
{
// initialize GLUT state based on command line arguments
glutInit (&argc, argv);
.....
.....
.....
}
but when i compile it said me that the 2 parameter are undeclared.
how i can resolve this problem,or modified the code ?
|
|
|
|
|
Non-console apps (like MFC ones) are not provided these parameters. Fortunately for you, MSVC features the global variables __argc and __argv which you can use instead.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thank you
but how i can use this globale variable __argc and __argv,because i am new in vc++ and programation.
|
|
|
|
|
It'd be something like
void initializeGraphics (int argc, char **argv)
{
...
glutInit (&argc, argv);
...
}
...
initializeGraphics(__argc,__argv);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i try but it don't run,i have the some mistake.
can u help me,please.
|
|
|
|
|
I have an SDI app (and it has to stay an SDI app). I need to be able to show different views, each with their own doc, but eachg view is required to maintain an open doc, even if the view isn't currently being displayed.
Is that possible? If so, how?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
|
Using VC&/C++/W2K. ::LoadImage() occasionally returns a system error 8 (Not enough storage is available to process this command) while trying to load a 1 mb. bitmap. Any ideas?
|
|
|
|
|
try to increase virtual memory
|
|
|
|
|
Hi hope someone can help me out here.
I have a program that recieves data from the serial port of the PC and saves it into a file using:
<br />
byte rec;<br />
<br />
:<br />
:<br />
:<br />
<br />
for(i=0;i<512;i++)<br />
{<br />
ReadFile(handlePort, &rec, 1, (LPDWORD)&bytes, NULL);<br />
<br />
fprintf(out, "%C", rec);<br />
}<br />
The problem is that it wont save the hex values 0x11 and 0x13 to the file when they are received from the serial port, I'm pretty sure it is because they are control characters, maybe? Also every so often it saves 0x0D to the file!
Any ideas how I can get around this problem?
Thanks in advance,
Paddy
|
|
|
|
|
Check out your fopen statement. I bet it looks like:
fopen("file name", "w");
try this instead:
fopen("file name", "wb");
-Sean
----
Shag a Lizard
|
|
|
|
|
Thanks you were right! I changed it and it has *nearly* solved the problem, it got rid of the random 0x0D in the output file but it still won't write 0x11 and 0x13 to the file.
Maybe it is that it isn't reading these values from the port?
Any ideas?
Thanks
|
|
|
|
|
Have you tried CFile::SetMode(hFile, O_BINARY) ?
|
|
|
|
|
Thanks for the help but I'm actually using win32, non MFC
Paddy
|
|
|
|
|
hi,
use the activex control mscomm!
this will solve all your problems.
markus
Dr-Kuulun
|
|
|
|
|
Thanks for the help.
For some reason I don't actually have that control in my visual studio. Think it is only with the older versions?
Paddy
|
|
|
|
|
I noticed that all the CDao??? classes have been depracated in VS2003 and will be removed completely in the next version. What is the best way (best way meaning it won't be depracatted in a year and will be transparent to the users).
slack
|
|
|
|
|
Sorry i forgot to finsih my thought... What is the best way to replace them.
slack
|
|
|
|
|
I tried to create a worker thread. However, I keep get the compile error "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (__cdecl *)(void)'"
Please help!
many thanks!
p.
//I have a global Thread function:
UINT connection(LPVOID pParam)
{
...
return 1;
}
//Start the worker thread
AfxBeginThread(connection)
{
....
}
|
|
|
|
|
try
AfxBeginThread ( connection , NULL ) ;
the second param is a user data
if u dont need it u can pass NULL
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
What's the rest of the error? It will tell you what the compiler is expecting. You can also put the cursor on AfxBeginThread() and hit F12. This will take you to the function's prototype.
|
|
|
|
|
Weird. Do you have connection() declared in the interface (*.h) file? AfxBeginThread() takes in as parameters more than one or even two.
Kuphryn
|
|
|
|
|
How i do to change the color?
And the Dialog´s color?
|
|
|
|
|
Catch WM_PAINT and/or WM_NCPAINT and paint it yourself.
|
|
|
|