|
BTW do you work for MicroSoft What Does MicroSoft MVP imply ???
Thanx Again Going to give it a shot
|
|
|
|
|
|
ForNow wrote: I would think so ...
Why? An endpoint knows NOTHING about the use of overlapped I/O
on the other end.
ForNow wrote: Do I have Share the hEvent Kernel Object which is part othe Overlapped Structure
No
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all. I'm implementing a macro that I need to have take multiple parameters.
Let's say I'm implementing a printf macro. (I know. I know. Just run with me for the example. )
#define PRINT(str,...) printf(str,__VAR_ARGS__);
Well, obviously, someone could invoke the macro thusly:
PRINT("My name is %s and I am %i years old.", szName, iAge);
After doing some research, I found __VAR_ARGS__ on gamedev.net. Just one problem: Visual Studio 2008 is not aware for __VAR_ARGS__.
Am I misspelling __VAR_ARGS__ or something?
What header file is __VAR_ARGS__ (or its correctly spelled version!!) defined?
K, thanks!
|
|
|
|
|
varargs.h by any chance?
|
|
|
|
|
Well, actually, I think I figured it out.
It's: __VA_ARGS__
#define PRINT(str,...) printf(str, __VA_ARGS__); //not __VAR_ARGS__ lose the first 'R'.
|
|
|
|
|
indeed, however vaargs.h won't cut it.
|
|
|
|
|
hehe. Yeah, I'm still searching for where __VA_ARGS__ *is* defined. I wonder if it's hardcoded into the compiler itself. The C99 standard says it should be supported - whether MS supports it or not I'm truly not at liberty to say until I've tested my still compiling application. (~700K lines).
|
|
|
|
|
I searched for varargs.h and only my WinARM and cygwin directories have those files.
Still searching the tree for __VA_ARGS__.
|
|
|
|
|
Hi, my folder C:\Program Files\Microsoft Visual Studio 9.0\VC\include
holds a varargs.h file containing definitions for _VA_LIST, va_start(ap), va_arg(ap,t), and more.
Yes, __VA_ARGS__ seems not to be there, I think you're right the compiler knows all about that one without any include file.
[ADDED]
Their documentation[^] knows about it; and you could test it with a much smaller program...
[/ADDED]
modified on Tuesday, December 9, 2008 1:09 PM
|
|
|
|
|
/hug
See, this is why I love The Code Project!
Thank you, Luc!
|
|
|
|
|
Looking at this page about variadic macros[^], it should be __VA_ARGS__?
You won't find it in any header file, though, because it's something built into the pre-processor.
|
|
|
|
|
i need help wrapping text for a clistctrl
i'm using either ownerdraw or customdraw to draw the items with multiple lines
my only problem is setting the individual row heights
i tried using ownerdraw + measureitem but that sets the heights of all the rows
any suggestions? thanks
|
|
|
|
|
|
that solution was for a ctreectrl
i'm now working on a clistctrl
i've been looking around and i dont think clistctrl has that iIntegral value to change the individual heights
|
|
|
|
|
oops
led mike
|
|
|
|
|
|
imagine a struct declared as follows:-
typedef struct
{
int integerArray[];
} testStruct;
I can instantiate like this:-
testStruct a = {
{1,2,3}
};
Which is all well and good. But, if the struct declaration is changed to an int* member:-
typedef struct
{
int *integerArray;
} testStruct;
How can I now instantiate it so that integerArray points to my array of {1,2,3} ??
in gcc, you can cast {1,2,3} to (int *), as follows:-
testStruct a = {
(int *){1,2,3}
};
But msvc doesn't allow that. Is there another way to make this instantiation?
thanks
Jon
|
|
|
|
|
Jon Hulatt wrote: Is there another way to make this instantiation?
How about:
testStruct a = { new int(1), new int(2), new int(3) };
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Very clever, anyway I suspect he wants the allocation to happen onto the stack.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How do we programmatically come to know whether an executable is digitally signed or not?
Is the signature in the form of section or a structure?
If it is like a structure then is there any document structure for it.
Does the size of the signature stored stored anywhere?
I am having two samples of same dll viz. signed and unsigned.
I find the difference in windiff only at the end of the files.
Thanks & Regards,
K. Sushilkumar.
|
|
|
|
|
WinVerifyTrust[^] helps
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi
I have an edit control which i have a character counter on
this works fine, but when i exceed 256 chars the cursor jumps to the start of the edit control
For my counter i am using
void CMyMessagePage::OnEnChangeEMsg()
{
UpdateData(TRUE);
int nBytes = lstrlen(m_message);
CString len;
len.Format("%d",nBytes);
m_sms_written = len;
UpdateData(FALSE);
}
Can anyone help
thanks
Simon
|
|
|
|
|
Check out SetLimitText(UINT /*param*/) API
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Check out SetLimitText(UINT /*param*/) API
thanks, i am already using SetLimitText
my problem is not the size of text allowed as i can exceed 256,
it is when i reach 256 characters the cursor jumps to the start
|
|
|
|