|
The child window will appear in the alt+tab window :p
Thanks anyway
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
You still have to add in the WS_POPUP style for that to work (IIRC).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Greetings,
I am very new to C++ and after many searches I am unable to figure out how to set the values of my array containing a character string.
class DataStruct
{
public:
char *mName;
char mInitial;
int mId;
int mAge;
int mDay;
DataStruct(char *Def_mName = "Paddy", char Def_mInitial = 'A' , int Def_mId = 1, int Def_mAge = 1, int Def_mDay = 1)
{
cout << endl << "Constructor Called ";
mName = new char [ strlen(Def_mName) + 1 ];
strcpy_s (mName, strlen(Def_mName) + 1, Def_mName);
mInitial = Def_mInitial;
mId = Def_mId;
mAge = Def_mAge;
mDay = Def_mDay;
}
When trying to use:
DataStruct data1[2] = { ("Andy",'A',1,20,30), ("Andy",'A',1,20,30 )};
I get the error:
error C2440: 'initializing' : cannot convert from 'int' to 'DataStruct'
Clearly I am not understanding somthing correctly either about strings or pointers, I am trying not to use specific string lengths if possible in this scenario.
Please can someone tell me what command I should be using to create this array, also if possible I would like to dynamicaly create the array data1 using new if anyone would be kind enough to show that example too.
Kind regards,
BS
|
|
|
|
|
Two problems:
1) You're using the wrong brackets in your initializer list:
DataStruct data1[2] = { ("Andy",'A',1,20,30), ("Andy",'A',1,20,30 )};
should be
DataStruct data1[2] = { {"Andy",'A',1,20,30}, {"Andy",'A',1,20,30 }};
2) You can't use an initializer list like this unless you remove the constructor from the struct.
See Compiler Error C2552[^] for details.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Many thanks Mark,
It did indeed work as you suggested, I am presuming that the compiler error was raised because the character array was not a fixed length.
I am plagued with a habbit of throwing myself off the deep end, anyway, thanks again for your very fast response.
|
|
|
|
|
bsharp52 wrote: I am presuming that the compiler error was raised because the character array was not a fixed length.
Actually it was the constructor...
From the docs:
"The following represent the reasons C2552 may fire when an aggregate initialization is attempted
on a type:
The type has one or more user-defined constructors."
where agregate is defined as:
"An aggregate type is an array, class, or structure type which:
Has no constructors
Has no nonpublic members
Has no base classes
Has no virtual functions "
Cheers!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
bsharp52 wrote: I am plagued with a habbit of throwing myself off the deep end
If you never threw yourself off the deep end you would learn a lot less - keep diving.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
You can keep the ctor if you initialize the array like this:
DataStruct data1[2] = { DataStruct("Andy",'A',1,20,30), DataStruct("Andy",'A',1,20,30) };
|
|
|
|
|
Cool! Thanks Mike!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
How to handle click event on icon which is placed on status bar?
Answers are appreciated.
|
|
|
|
|
You can respond to the message you indicated in NOTIFYICONDATA.uCallbackMessage when you
added the icon with Shell_NotifyIcon().
NOTIFYICONDATA.hWnd needs to be valid and NOTIFYICONDATA.uFlags needs to have the NIF_MESSAGE
flag as well.
Or were you referring to a status bar in an application window...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
yes i am referring to a status bar in an application window.
|
|
|
|
|
Sorry
Looks like Hans has got it!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
It's rare that I can beat you, Mark!
|
|
|
|
|
Hans Dietrich wrote: It's rare that I can beat you
Maybe in assumptions and/or jumping to conclusions, or not reading posts thoroughly
Cheers!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
I hope that post came across the way I meant it to
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
No prob.
Where in LA are you located?
|
|
|
|
|
North Orange County - Fullerton. You're in LA? For some reason I was under the impression you were in Europe...I figured you just never slept since you were around here the same hours as me.
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Derive a new class from CStatusBar. Add WM_LBUTTONUP handler, and in this function loop through all panes of status bar -
- use GetStatusBarCtrl() to get ptr to control
- use CStatusBarCtrl::GetRect() to get rect of pane
- use rect.PtInRect() to see if click was in pane's rect
(I assume you mean app's status bar.)
|
|
|
|
|
Thank you Hans.
Yes its an application's status bar.
I'll try ur solution. Is there any other better solution?
|
|
|
|
|
Super Hornet wrote: Is there any other better solution?
Probably, there always is. If you find it let me know.
P.S. Please stop using SMS spelling.
|
|
|
|
|
Hi everybody.
I encountered a problem while using the Video Mixing Renderer 9 to display video file and camera.
In fact, each time I change the video file to play, I destroy the graph by that I mean I remove all the filters in the graph. Then, I build a new graph again including the Video Mixing Renderer in it.
The problem is that it works fine for a moment but while using about 10 times this method, my video is not shown and there is an Active Movie Window which appear and displays nothing in it.
I haven't find out what was the problem.
Could somebody help please?
Thanks in advance
|
|
|
|
|
Hi all,
How can I catch/handle a double-click (left mouse button) on the header control of a CListCtrl.
TIA
|
|
|
|
|
Handle the HDN_ITEMDBLCLICK message that will be sent from the header.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hai evryone,
I have a problem with internet file download i.e.,synchronous download.this is how it is..
1. I have an internet file which is to be downloaded using multiple threads
(single file/same file).I'm using UserInterfaceThreads where in i pass
parameters such as starting position of a file, temp name of the file
etc.. problem is i'm unable to download to diff files(threads)
synchronously.i.e., files are downloaded one thread after the other.
code is given below...
parameter fPos: the start position of the file to be downloaded which
is initilized when thread is created.
m_hHttpFile = HttpOpenRequest(m_hHttpConnection, "GET", ServerFile,
NULL, NULL, ppszAcceptTypes, INTERNET_FLAG_RELOAD
|INTERNET_FLAG_KEEP_CONNECTION, NULL);
::InternetSetFilePointer (m_hHttpFile,fPos,0, FILE_BEGIN, 0);
do
{
::InternetReadFile(m_hHttpFile, szReadBuf, TRANSFER_SIZE,
&dwBytesRead))
...... write in to my temp files..
}
while(sum
|
|
|
|