|
Because in your example, letters is an array of pointers. Which means that the pointer to the first element of the array is in fact a pointer to a pointer of char array, and not a pointer to a char array. There is one level of indirection more.
In brief, letters is equivalent to char** and i is equivalent to char* (removing the const because that's not part of the problem). So you see, the two pointers are not the same (remember that C++ is a strongly typed language so you won't be able to save a pointer to another one if they are not exactly the same type).
|
|
|
|
|
Ah, ok. now i get it.
thanks for the explanatioN!
|
|
|
|
|
Actually, these are equivalent:
const char *p = arr;
const char *p = &arr[0];
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I'm using a static splitter window in my SDI application. But I want the size of the panes to be constant and dont want the user to change the size of the splitter windows by using the splitter bar.anybody know how to do it
|
|
|
|
|
Derive your own splitter window class, say CSplitterWndEx and override the NcHitTest handler. Here comment out the code written by the appwizard i.e. do not call the base class, before that only return TRUE from the function.
This will take care of your problem
Sunil
|
|
|
|
|
Is it not possible to handle the normal "OnSize" of the pane and refuse it ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
OnSize is sent when the size has already changed. So, it is easier to simply not allow to change the size.
|
|
|
|
|
Also, by overriding OnNCHittest the cursor will not change to the resizing cursor. No use giving the user a visual clue that there is resizing and then disallowing it.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
The current header file i have (Winsvc.h) neither contain a definition of the structure "SERVICE_STATUS_PROCESS" nor the function "QueryServiceStatusEx(...)".
I am using Visual C++ 6.0.
Can any body help me with that?
Best Regards,
Simos
|
|
|
|
|
softgrid wrote: The current header file i have (Winsvc.h) neither contain a definition of the structure "SERVICE_STATUS_PROCESS" nor the function "QueryServiceStatusEx(...)".
I am using Visual C++ 6.0.
Can any body help me with that?
Well the documentation says this...
Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Header: Declared in Winsvc.h; include Windows.h.
|
|
|
|
|
Download and install a NEWER version of the Platform SDK and make VC point at the new libs and headers - your problem will be solved.
The original VC++ headers and libs were out before some of these newer functions, so it is not found in the WinSvc.H that you posess.
If you DO find it in your header, check for it bracketed by a WIN32 definition.
You need to do something like
#define _WIN32 0x0501
or some such value to make it visible.
They did this so you could target backlevel versions of OS with a build and be warned if you were 'linking' to functions that did not exist at the time.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hi everyone,
since few weeks i look for a solution for my problem.
I like to open my MDI Children with Parameters.
For example if i click an element in a list, his ID will be the parameter for the new Child ( or another view with the details of this ID )
So, the new View must known which ID will be loaded...
Whats the best procedure ?
Big thanks
|
|
|
|
|
baerten wrote: Whats the best procedure
Override your base view class, and add a parameter in the overriden "Create" function to pass the ID.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Ok, but there i must derive many functions from the Template classes.
I startet like this:
i created a new class, derived from CMDIChildWnd
There i can store all informations i want.
At the Create-Event i associate with the Frame the View:
CCreateContext CC;
CC.m_pNewViewClass = RUNTIME_CLASS ( MyView );
CC.m_pCurrentFrame = this;
MyView* ActView = DYNAMIC_DOWNCAST( MyView, this->CreateView(&CC) );
if(ActView) {
ActView->ShowWindow(SW_SHOW);
ActView->OnInitialUpdate();
// Set this view active
SetActiveView(ActView);
RecalcLayout();
ActView->ResizeParentToFit(FALSE);
//RecalcLayout();
}
it works, but the border of the frame is displayed very confused.
The Minimize&Close Buttons are fixed ( aren't all the time in the right corner )
And the Dialog in the View has a wrong size ...
You have already made an application like this?
I'm more than one week over this problem
Thanks
Sprichst du besser Deutsch? Ou plustot francais?
|
|
|
|
|
I have a difficulty...
when I want to make a LPCSTR variable, I do this:
LPCSTR test = TEXT ("hello");
Now I want to make a LPCSTR,including "hello" + name of a persion, which changes every time.
I can't do below:
CString name = "John";
LPCSTR test = TEXT ("hello" + name);
or
CString name = "John";
name = "hello" + name
LPCSTR test = TEXT (name);
please tell me how to do to achieve that result, or show me some pages related to changes of LPCSTR.
|
|
|
|
|
vtalau wrote: CString name = "John";
LPCSTR test = TEXT ("hello" + name);
This should not be done.
Always use TCHAR types with TEXT and _T , else when you compile with _UNICODE defined it could lead to waste of time.
You can do likewise...
CString name = _T( "Nibu " );
name += _T( "Hello" );
LPCTSTR test = name; There is no need to wrap name inside TEXT() . You should be careful when using statements like
LPCSTR test = name; So always adopt a generic approach. Try to use _T() or TEXT() wherever possible along with their counterparts like LPCTSTR .
|
|
|
|
|
Nibu babu thomas wrote: name += _T( "Hello" );
Just a detail, but this should be
name = L("Hello")+name;
otherwise: "Nibu Hello"
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Rage wrote: otherwise: "Nibu Hello"
|
|
|
|
|
vtalau wrote: TEXT
Never seen this...
CString str="Hello "+name;
LPCTSTR string = str.operator LPCTSTR();
or
CString str="Hello "+name;
LPCTSTR string = (LPCTSTR)str;
Also, see this[^]
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Dear all
I write one small program to read and write data to Parallel mode in ECP mode.
I write one thread for this purpose. but when I stop and start the thread, Cpu usage of computer goes to 98% .
Do you know what is the source of this error.
Regards
Monhi
|
|
|
|
|
had u tried to debug n see where the actual problem comes i mean code that take the CPU to 98%
Tasleem Arif
|
|
|
|
|
What's going on in your thread? Polling in a loop?
You need to give other threads some time too!
|
|
|
|
|
Hello all
I have a dialog box on which a bitmap is loaded with LoadBitmap function . Its static . But if I change the display settings from 96 to 120 DPI then the dialog appears big but bitmap is not streched. Can anyone please tell me how to redraw my bitmap so that it fits to the dialog with new DPI ?
redindian
|
|
|
|
|
I think you asked this question did you see my reply?
|
|
|
|
|
Hi
In fact i saw your answer , but I did not understand when you said the bitmap does not display .
In fact bitmap is displayed but it has not streched to the new size of dialog . The bitmap size remains static .Can you please help me how I can increase it to the new size due to increase in DPI from 96 to 120 ?
redindian
|
|
|
|