|
|
it is really a very good reference. Thanks a lot
|
|
|
|
|
I have a win32 dll, and I want to use GetModuleFileName in it. But if I go to include stdafx.h or windows.h, I get bizarre compile errors. I have another win32 dll in which theres no problem. This one has a bunch of static ints and I get errors like:
error C2062: type 'int' unexpected
error C2062: type 'int' unexpected
error C2059: syntax error : ')'
error C2062: type 'int' unexpected
error C2062: type 'int' unexpected
etc.
The file has a ton of forward declares like:
static int
acf_llrt( float *hfdata, param_type *prm_type, int *m, int *n,
float *dtemp, int *idat1);
As soon as I remove the #include all is well.
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
|
|
|
|
|
hi folks
i'm interessted to develop (C++ with Visual C++ as IDE) a plugin for the MSN Messenger that will be integrated in the messenger and started with the messenger. does anyone know how to develop a plugin for the MSN messenger?
|
|
|
|
|
See this MSDN link: Windows Messenger API[^]
There's a scarce amount of examples available for writing a Messenger add-in. The best approach would be to write an external application that interfaces with the Messenger, and adds to it. But as for writing an authentic Messenger add-in, then sorry, nothing I can do
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Is there an MFC function to terminate an application? (like AfxAbort(), but without the ugly error message)
[insert witty comment here]
bdiamond
|
|
|
|
|
This line causes terminate the application:
::AfxGetApp()->ExitInstance();
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
I just ended up calling my CMainFrame class's OnClose() function, since that's where I'm at when I need to do it anyway, and it works fine. I tried ExitInstance first, and it didn't work right. thanks, though!!
[insert witty comment here]
bdiamond
|
|
|
|
|
Mmmm...
In that case your question will be: "Howto close correctly the main frame window in a MFC application?"
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
Yeah, maybe I did go about asking the question the wrong way. But I got it now. Thanks
[insert witty comment here]
bdiamond
|
|
|
|
|
The prefered method is to post a WM_CLOSE message. This is what happens when you close an application via Alt+F4, or by selecting Exit from the File menu. Note that this is not the same as calling PostQuitMessage() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
After installing the latest DX9 SDK, the DirectX panel is gone.
I wonder if it is normal? If so, how do I switch between retail
and debug?
When I use Dxdiag, the program reports that "d3dref.dll" "d3dref8.dll" and "d3dref9.dll" are Final Debug.
I wonder if it is normal?
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|
|
Dunno about normality. What even is the DirectX panel ? You mean a Control Panel applet ? I have never even had one on my computer..
I have DirectX 9.0b run-time, and the latest DirectX 9 SDK installed. The files you mentioned are marked as "Final Debug" for me also. However my DirectX games and applications work flawlessly, so I must presume that there's nothing wrong.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
I have a list control with the default multiple selection style.
The problem is that if I drag the mouse over it, it will not select all the itmes, like we do for example in a CListBox class.
If I want to select multiple items, I have to use SHIFT+ Arrow key.
How do I enable the mouse doing it
Shay
|
|
|
|
|
To enable select multiple items using the SHIFT key and the mouse or special key combinations, create the control with LBS_EXTENDEDSEL style, or set this style with.
m_yourListCtrl.ModifyStyle(0,LBS_EXTENDEDSEL);
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
The problem is that :LBS_EXTENDEDSEL is for a list box.
Is there anything for CListCtrl or CListView ?
|
|
|
|
|
Yes,
To modify this style in a CListView use:
CListCtrl& theCtrl = GetListCtrl();
theCtrl.ModifyStyle(0,LBS_EXTENDEDSEL);
or inicialize this ina PrecreateWindow function.
BOOL CYourOwnListView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= LBS_EXTENDEDSEL;
return CYourOwnListView::PreCreateWindow(cs);
}
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
just wondering, is there a better thing than strtok ( and related ) ?
I need to be able to count the number of delimiters as well as tokens; not really count but scan for them. if one one my delimiter is the space, I want to know that if I have 2 spaces, I will get an empty token between them.
for example, if my delimiter is ; and I have the following string :
text;text;;text;text
I wil get something like :
text
;
text
;
;
text
;
text
I could make my own version of it, but if such a thing exists, I'd be glad to use it.
I've just learned about the boot::char_separator which would do what I like, can I use only a subset of boost ?
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
you can just do it manually
for (
int i=1;
i<=strlen(youstring)-1;
i++
)
{
if (yourstring[i]==';')
int tokcount++;
if ((yourstring[i]==';')&&(yourstring[i+1]==';'))
int sepcount++;
}
try and tell me if this is what you want.
gabby
|
|
|
|
|
I decided that I neeeded to make my own ...
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I want to create an array of variable addresses (different types).
e.g.
void * addressArray[20]; // Is void pointer correct?
unsigned status : 4;
short data1;
long data2;
float data3;
double data4;
<br />
addressArray[0] = &status;<br />
addressArray[1] = &data1;<br />
addressArray[2] = &data2;<br />
<br />
<br />
CString formatStr;<br />
<br />
formatStr.Format("Data 1 = %d", *data1);
printf(formatStr); Is this possible, I have heard of a type called variant but never used it.
|
|
|
|
|
|
Thanks for your post. I have spent the day trying the new OleVariant and VARIANT types.
I found that the example project did not do what I required, so I opted for the VARIANT, but have a problem. When I display the data is is always a funny value and when I set it to to 0, then it always remains at 0. I have just concentrated on dealing with a unsigned short at present; but will want to deal with floats, doubles etc later
See code below:-
VARIANT varData[5];<br />
<br />
union<br />
{<br />
unsigned short mess_13_tp1_w01_data1; <br />
unsigned short mess_13_tp1_w03_data2; <br />
unsigned short mess_13_tp1_w02_data_X; <br />
unsigned short mess_13_tp1_w02_data1_X; <br />
unsigned short mess_13_tp1_w02_data2_X; <br />
unsigned short buffer[32];<br />
}mess_13_m_tp1_display;<br />
<br />
<br />
VariantInit(&varData[0]);<br />
varData[0].vt = VT_UI2;<br />
varData[0].puiVal = &mess_13_m_tp1_display.mess_13_tp1_w01_data1;<br />
VariantInit(&varData[1]);<br />
varData[1].vt = VT_UI2;<br />
varData[1].puiVal = &mess_13_m_tp1_display.mess_13_tp1_w02_data_X;<br />
VariantInit(&varData[2]);<br />
.<br />
.<br />
Etc<br />
<br />
for( j = 0; j < message.getNoFields(); j++)<br />
{<br />
m_cSignalList.SetItemText(j , 0, message.details[j].fieldDesc);<br />
m_cSignalList.SetItemText(j , 1, message.details[j].signal);<br />
formatStr.Format(message.details[j].display1,&message.varData[j].uiVal);<br />
m_cSignalList.SetItemText(j, 2, formatStr); formatStr.Format(message.details[j].display2,message.varData[j].uiVal);<br />
m_cSignalList.SetItemText(j, 3, formatStr);<br />
m_cSignalList.SetItemText(j , 4, message.details[j].unitsStr );<br />
}
I use a ListCtrl to display and modify the data, hence the need to use VARIANTS.
Any suggestions to overcome this problem?
grahamfff
|
|
|
|
|
Hello,
I want to save a file in my exe project and
use it (Read and Write),
this file is in my exe file not
in any folder!
Best Wishes,
Thanks.
|
|
|
|
|
Use the CFile class...
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|