|
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
|
|
|
|
|
Hi
There are some problems with UpdateData(true) / UpdateData(false) and you may lose your position if the system thinks the string has changed in the process (it happens also with numbers and decimal points etc) ... you can use CEdit::GetSel and CEdit::SetSel to save and reset your cursor position... hope this helps!
|
|
|
|
|
|
Hi
I'm creating my own control. I dynamically creating CListBox over the other controls - it's my combo list control. My problem is that controls from behind my CListBox (eg. CEdit controls) getting to front. It disturbs everything. I tried to use myList.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ) - but it's not working. Is there any way to make control topmost (something like modal dialog) over other controls. Plaese help...
modified on Tuesday, December 9, 2008 7:17 AM
|
|
|
|
|
I am not sure but you can have a try,
You need to SetWindowPos for all the controls that intersect with your listbox.
The call should be in the same order you would like to.
Ex.
SetWindowPos(EDIT_1)
SetWindowPos(EDIT_2)
SetWindowPos(LISTBOX) //Top-most.
|
|
|
|
|
I believe that wndTopMost is intended for windows (usually modeless dialog boxes) and not child indows (eg controls). Simply use wndTop and it should do the trick!
|
|
|
|
|
sorry - but it's not working:
picture
two first - wndTopMost, third - wndTop - still no solution
some code from my control (derived form CEdit):
lista - derived from (CListBox):
lista.Create( WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_HSCROLL|LBS_NOTIFY, CRect( rect.left, rect.bottom, rect.right,rect.bottom+100), parentWindow, IDC_LISTBOX );<br />
lista.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);<br />
|
|
|
|
|
Hi,
Did you find any solution for this finally ? I am having the same problem now.
Thanks...
|
|
|
|
|
Check the tab-order (Strg+D) in the resource view of VS, or change the order in the rc-dile
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi!
Let me describe what I have and then I'll explain my problem: I have a SDI application which has a CFormView. In this CFormView I have several CDialog derived classes defined as child windows. In one of these CDialog I have a CView derived child window (a CHtmlEditView to be accurate).
The problem is that whenever this view has focus my menus (through CCmdUI* pCmdUI) do not get updated anymore... Ideally, I would like the formview to be in charge of the menu update. After all it's only incidental that the chid window is a view...
I suspect I need to have a dab at CCreateContext... but my view (which is part of a control I have not programmed although I have the source code - it's from here and I'd rather not change the code so I can use the future updates) has been create by Create and not CreateView.
So here are my questions:
a) can I ask that a view not to mess up with the CCmdUI* pCmdUI and let a parent view deal with it?
b) if a) not possible, can I assign a CCreateContext to a view after its creation?
c) if a ) and b) are not possible, can someone pay me a round of drinks so I can forget my dreams of good design and encapsulation?
Thanks in advance
|
|
|
|