|
Here is one solution.
::SendMessage(hWnd, WM_COMMAND, MAKELONG(ButtonID, BN_CLICKED), reinterpret_cast<lparam>(ButtonHandle));
kuphryn
|
|
|
|
|
|
Hello
Is it possible to use an itoa function in an win32 application??? because I'm trying to use it and i get an error: can not locate xtoa.c and it asks me for the path and if I cancel that I will get an unhandle exception. how can I do a conversion from int in char if I can not use itoa???(in win32 application I can not use sprintf and other functions like this...)
Tx
Mirelutza
|
|
|
|
|
You are calling the routine wrong.
Why can't you use sprintf?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
If I use sprintf is the same problem. I get the message that it can not find sprintf.c . What I am trying to do is to print in an listbox some messages that I do not have them all at once, so I am using a string array in order to do this by sending a message to the specific listbox. I'm concatenating the message and I have to use an integer value in the string message. That's what i'm trying to do!
Mirelutza
Tx
Mirelutza
|
|
|
|
|
sorry but sprintf(), itoa()... are ANSI (so standard) C functions. they are not dependant on wether they are used on Win32, MFC, Console...
did you include the right header file in your project ?
if so, do you use the right library ?
TOXCCT >>> GEII power
|
|
|
|
|
Hi!
I included the libraries stdio.h and stdlib.h and I think is good. But still I'm doing something wrong... and I do not know what...
tx anyway
Mirelutza
|
|
|
|
|
The only reason you would be seeing that message is if you are trying to step into the routines in the debugger. I would guess that you are doing this because the routines are crashing. They are crashing because you are calling them wrong.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
This is the way I'm using it:
int crttime=0;
char buff[30];
itoa(crttime,buff,10);
is it wrong???
10x,
Mirelutza
Mirelutza
|
|
|
|
|
itoa(crtime,buff,10);
should read
itoa(crtime,&buff,10);
Ant.
|
|
|
|
|
You can use the function _itoa()
here is the prototype:
char *_itoa( int value, char *string, int radix);
make sure you include these header files:
<br />
#include <stdlib.h><br />
#include <stdio.h><br />
Steve
|
|
|
|
|
Yes I've included the libraries and is still not working. Do I have to have a char* variable for example:
char* ch;
ch=itoa(value,string,10);
I think I tried like this too but it's still not working...
Am I doing something wrong???
Mirelutza
Mirelutza
|
|
|
|
|
I've done it! thanks to all...
|
|
|
|
|
I am trying to detect remotly whether a user is currently logged on to a specific machine. The platform is Win NT/2000/XP. Does someone is familier with an API to do this ?
|
|
|
|
|
Hey, can you please help me with this task...
I want to code a replacement list for variables. This list should be stored in a simple text file or in an simple TextArray (e.g.MAP).
e.g.
replacement.txt:
#txtTextVar - pDoc->m_TestVar1
I mean, that all places with #txtTextVar should be replaced with the content of pDoc->m_TestVar1.
How can I do this job?
|
|
|
|
|
Yes, a map is one solution. Implement it.
Kuphryn
|
|
|
|
|
Thanks you for your fast reaction,
but my problem is howto say my prog that "m_TestVar1" is m_TestVar1, you know what I mean? Let me make it clear,
when I have a string like "m_TestVar1" out of a textfile, how can I say my programm that it should replace #m_TestVar1 with the content of "m_TestVar1".
The problem is the assigment between "m_TestVar1" (as a given string) and m_TestVar1 as variable.
|
|
|
|
|
One solution is a map of, say, string key and "variable" value (whatever type you want).
Kuphryn
|
|
|
|
|
I think you misunderstand me.
Let me say it so:
i like to have a funktion with CString parameter.
<br />
int MyNewFunction (CString szVarName)<br />
{<br />
...<br />
return value;<br />
}<br />
szVarName should be the name of the variable. Now the function should return the value of the variable.
e.g.
<br />
m_iTest = 20;<br />
<br />
int iNewTest;<br />
iNewTest = MyNewFunction("m_iTest");<br />
<br />
<br />
Thanx for your help
|
|
|
|
|
Correct. In your example, one solution is a map of CString key and integer value.
Kuphryn
|
|
|
|
|
use some sort of struct that stores the name and the value and then store the struct in a map or array or linked list and then just go through the list with string comparisons and once you find the right one get the value
|
|
|
|
|
Can you give me a small sample please?!
|
|
|
|
|
this is just a sample as i said you can use any data storage thing you want like a linked list or map you could also use a class instead of a struct there this is just a small example of what i think your looking for
<code>
int m_Value1 = 0;
int m_Value2 = 1;
struct stuff
{
char*name;
int id;
};
stuff_array[2] =
{
{"m_Value1", m_Value1},
{"m_Value2", m_Value2},
};
int GetVal(CString name)
{
for(int i = 0; i < 2; i++)
{
if(name == stuff_array[i].name)
return stuff_array[i].id
}
}
</code>
|
|
|
|
|
I need a 16 bit compiler to compile the project that located at:
Microsoft Knowledge Base Article - 324409[^]
Because I tink BLDDRV.cpp (that Calls the 16-bit API which causes the INF driver index to be built ) need a 16 Bit compiler. Is it correct!?
I can NOT compile it by MSVC 6. I get many error by VC6 such as:
c:\98ddk\inc\win98\inc16\windows.h(181) : error C4226: nonstandard extension used : '_near' is an obsolete keyword
(Is older version of MSVC such as VC++ 1.52, 16 bit compiler?)
|
|
|
|
|
Behzad Ebrahimi wrote:
(Is older version of MSVC such as VC++ 1.52, 16 bit compiler?)
Yes. From time to time you can find a copy on EBay.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|