|
Hi, I am just starting to learn C(++) and therefore the following might be a silly question to you. But maybe your explanations will help me to understand some principles of C++:
As far as I know pointers are declared like char *xyz (with the * bound to the beginning of the variable name). But in the C++/MFC-Help, pointers are mostly declared as CWnd* xyz (the * is following the type/class name).
What is the difference?
Thx a lot
Christian Planckh
|
|
|
|
|
There is no difference. It's just a matter of style. You can put as little or as much whitespace as you want. The following would all be OK:
<br />
char*xyz;<br />
char *xyz;<br />
char* xyz;<br />
char * xyz;<br />
|
|
|
|
|
I have a Dialog app that creates a PropertySheet .
While performing
propertySheet.Create()
I had allowed the windows Style to be -1 as default. In my main Dialog I have a routine where I call a Method of one of the pages in the PropertySheet that does
a CFileDialog.DoModal(). With the above mentioned window style of -1 for the PropertySheet all works fine .
I changed the style of the PrpertySheet in the Create func to be
WS_VISIBLE | WS_CHILD and the call to the CfIleDialog.DoModal() doesnt end (I never see the FileDialog displayed ) . What is going on ? Any clues . Please help
Engineering is the effort !
|
|
|
|
|
Hello all
I wrote a windows service and installed it. I was able to start and stop the service from Control Panel - Administrative tools - Services. But whenever I try it from command line using the following
net start ServiceName
it's failing. The above command say's service started but the service is shown as stopped when I see it in Admnistrative tools - services. Even the task manager is not showing the service in the process list.
Any ideas?
Many thanks for your help,
Hari.
|
|
|
|
|
I'm developing a single document MFC application.
I'd like to know how I can center a CFromView into the client area of th main window.
I've tried CenterWindow method but it doesn't work.
Can someone help me?
Bye and thank you,
Wollet
|
|
|
|
|
Hi all,
I am trying to build my own C++ framework around the win32 API. The purpose of doing this is to learn how things work behind the (sometimes) mysterious scenes of MFC.
My question is the following:
When painting a dialog in VC, you can specify that a control has the WS_TABSTOP style. If you do that, you can also specify the taborder in which the focus will traverse when using the TAB key. In my framework, controls are also created using WS_TABSTOP.
Firstly, in my framework, it seems the tab key has absolutely no effect whatsoever. Is the taborder functionality programmed in MFC somewhere? I couldn't find it, but maybe I am not looking close enough.
Secondly, how can I specify the order in which the focus will traverse? It seems not related to the ID value of the control.
Thirdly, if someone is interested in the code I am using related to answering this question, let me know.
Best regards, Perry
|
|
|
|
|
All these functions are exported from Shlwapi.dll (7/24/2002) as (ASCII: StrRetToBufA, UNICODE: StrRetToBufW etc)
If not included in your version of Shlwapi.h you could consider checking in the latest W32 SDK (note that the standard MSDevStudio files are usually quite out of date).
Quick solution might be to add its declaration yourself in your code.
You would need of course to make sure that the right version of Shlwapi.dll is installed on the target system
|
|
|
|
|
Perry Bruins wrote:
it seems the tab key has absolutely no effect whatsoever.
You need to call IsDialogMessage() in your message loop for the standard keyboard navigation to work.
Perry Bruins wrote:
Secondly, how can I specify the order in which the focus will traverse?
Tab order is the same as the Z-order of the controls. Use SetWindowPos() to change the Z-order.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi all
how I make my own Agent Character storage(.acs file) in VC++. can u tell me the format of (.acs file).
Thanks
|
|
|
|
|
In the following code which is a selfdeleting code on NT i cant seem to understand why the call CloseHandle((HANDLE)4); is there?
what is this 4 value that is casted to a HANDLE?
<br />
#include <windows.h><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
char buf[MAX_PATH];<br />
HMODULE module;<br />
<br />
module = GetModuleHandle(0);<br />
GetModuleFileName(module, buf, MAX_PATH);<br />
CloseHandle((HANDLE)4);<br />
<br />
__asm <br />
{<br />
lea eax, buf<br />
push 0<br />
push 0<br />
push eax<br />
push ExitProcess<br />
push module<br />
push DeleteFile<br />
push UnmapViewOfFile<br />
ret<br />
}<br />
<br />
return 0;<br />
}<br />
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
I can't be the only one that thinks this can't be true, or you'd never be able to create more than one active file mapping for a given process?
Steve S
|
|
|
|
|
Yeah, I must not have interpreted it correctly. I don't really understand it, so I won't even try to interpret again. Anyone else?
|
|
|
|
|
Having read the thread, I think the answer is simpler. There's a qualifying comment that says mapping the file for the current EXE always returns 4.
I suspect that this is 'true' because the EXE is already mapped to address 00400000, and it's just something happening to obfuscate the value returned, or there's some shifting/misreading going on.
In other words, the code is committing suicide in a fancy way by unmapping itself from memory while it's executing. The CPU pipeline cache may then probably prevent a page fault while it terminates.
Steve S
|
|
|
|
|
Or for any other orelse they will overlap, right?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi There!!
I'm gettin' mad with these debug errors:
game.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4
Debug/game.exe : fatal error LNK1120: 1 unresolved externals
And note that I added the ddraw.lib in the 'Link' section, installed DirectX 9 SDK(and is at the top of the 'directories'list) and included ddraw.h in the source code... but the compilers is still gettin' these cursed errors!!!
What can I do?!?!?
|
|
|
|
|
Try linking with "dxguid.lib" ... should fix that error :> and btw, DirectDraw has version 7 and isnt going any further then that, just as a smal note :>
|
|
|
|
|
i need to write a C++ program to access the system environment variables..can someone help me out in this regard!
ranjani
|
|
|
|
|
|
or
int main(int argc, char* argv[], char* envp[])
u can loop on envp till its null
or
GetEnvironmentVariable
SetEnvironmentVariable
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I've got some confusing code to try and fix. It appears to be using CDO to send a message and it works fine from the command line. however, from an NT service it fails due a MAPI Logon error. I know this is usually to do with the profile, but I now think it's down to CDO as if I replace the CDO logon code with a standard MAPILogonEx() call, it logs on with no problem. I guess it may be down to the parameter the previous developer wasn't passing in at logon time, for example, MAPI_NT_SERVICE. I don't know how to do this in CDO and I cannot find any documentation.
Can anyone help?
Can anyone suggest any links to info?
Here's a brief summary of the code I need to get working:
1. CLSIDFromPogID() returns "MAPI.Session " CLSID .
2. CoCreateInstance() on the MAPI CLSID returns IDispatch interface.
3. Calls the Logon() method on the IDispatch interface with several parameters (this is where I believe I should be able to pass my extra parameters), but how?
4. Call GetIDsOfNames() to get the DISPID for the method required.
5. Call IDispatch::Invoke() with the named member ID
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Windows does not load the user's configured profile when logging on as a service. This may be the source of your problem.
You could try calling LoadUserProfile before calling Logon .
|
|
|
|
|
No, I'm definitely specifying the user profile and password if necessary. They are passed as the first two parameters to the Logon method via MAPI's IDispatch interface. I know it works just fine as an NT service because, as I said, replacing the CDO code with Extended MAPI, works fine. Unfotunately, if I were to use Extended MAPI there is a lot of extra work to do replacing all the existing code...
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Sorry, I mean 'user's profile' in the sense of the registry entries under HKEY_USERS and mapping HKEY_CURRENT_USER to the appropriate key under HKEY_USERS . This is not done for a batch, service or network logon, it's only done by USERENV.EXE for an interactive logon.
|
|
|
|
|
That's not a problem. I specify the MAPI_EXPLICIT_PROFILE flag. All I need to do then is specify a valid profile and password if required.
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|