|
The difference is that one wouldn’t work--declaring a const * char would give you an error. The compiler, VC6 anyway, would interpret it as a pointer to a constant int, named char. The reason it would crap out is because you can't use keywords as variable names.
cheers,
-B
|
|
|
|
|
Thanks, Ben pal!
Cheers,
George
|
|
|
|
|
As mentioned above, const * char is meaningless. However char * const has meaning. As mentioned here[^], you have to read pointer declarations backwards.
const char * means a pointer to a character that is constant. The pointer can change but the data being pointed to cannot.
char * const means a constant pointer to a character. The pointer cannot change but the data can.
const char * const means a constant pointer to a constant character. Neither the pointer nor the data can change.
The C++ FAQ is a terrific place to learn all kinds of good stuff. Go here[^].
J
May the bear never have cause to eat you.
|
|
|
|
|
Thanks!
It helped a lot!
Cheers,
George
|
|
|
|
|
If you meant what's the difference between const char* and char const* , there is none, they're semantically identical.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thank you, Michael pal!
Cheers,
George
|
|
|
|
|
The first time Isaw this mentioned in MSDN is when you delete a menu item, but then it says you should call this function any time you change the menu. Just to be certain, this mens you call DRawMEnuBAr after anything like ModifyMenu , AppendeMenu etc? I didnt see it used in their sample code.....
Appreciate your help,
ns
|
|
|
|
|
OK, I may be guessing for some of this so take with a pinch of salt.
You need to call drawmenubar when a visual aspect of a menu (such as height, #items etc) that is in use by the system changes. For example, if you change the HMENU resource in use by your mainframe (for example, adding a new top level menu item) then you should call this so that the windows will correctly draw itself. If its a menu that is not in use by any window or is visibly being displayed (i.e as a popup) then you don;t need to call this as when the menu is finally used all the info will be upto date and the menu should show correctly.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Okay> thanks. They didnt clarify that in MSDN, and your guess sounds plausible... . No wonder I didnt see it in their code samples illustrating submenu functionality...
Appreciate your help,
ns
|
|
|
|
|
how can i enlarge bitmap size on menu? i am trying byusing below code. but i am not getting . please help me to solve this task.
m->LoadMenu(IDR_MENU1);
m->CreatePopupMenu();
cbmp.LoadBitmap(IDB_BITMAP1);
m->InsertMenu(0,MF_BYPOSITION | MF_STRING,100,"&Connect \t CTRL+C");
m->SetMenuItemBitmaps(0,MF_BYPOSITION | MF_BITMAP,&cbmp,&cbmp);
dbmp.LoadBitmap(IDB_BITMAP2);
m->InsertMenu(1,MF_BYPOSITION | MF_STRING,100,"&Disonnect\t CTRL+D");
m->SetMenuItemBitmaps(1,MF_BYPOSITION,&dbmp,&dbmp);
SetMenu(m);
thanks alot for your help
|
|
|
|
|
Try to use owner-draw menu. There a lots of this stuff at code www.project.com or www.codeguru.com
|
|
|
|
|
in Visual C++, if type a . (dot) after an object, VC pops up a prompt window which displys fields and functions of the object.
the prompt popup window has 2 features:
1. no focus (focus is still on VC main frame, not on the popup window).
2. if mouse clicks at anywhere (inside the popup window or out of it), the popup window is closed.
i want to develop a similar popup window, my Q is:
1. how to create the popup window which has no focus on.
2. what message is passed when mouse clicks (WM_KILLFOCUS whould not work because of no focus).
thx.
includeh10
|
|
|
|
|
includeh10 wrote:
. how to create the popup window which has no focus on.
Create a Modeless dialog and unset the Focus once it has been created. Then, when your popup takes the focus,, just unfocus it (this will give focus back to the last control or win that had it).
includeh10 wrote:
2. what message is passed when mouse clicks (WM_KILLFOCUS whould not work because of no focus).
2.Just intercept WM_LBUTTONDOWN and WM_RBUTTONDOWN from the main app which must be underlying, or intercept them from within your popup, and WM_NCMOUSE (not sure about this one, but it is WM_NCMsomething) also, for clicking "not in the window".
BTW, i do not think that your pop-up window should not grab the focus, but just react as it would do.
~RaGE();
|
|
|
|
|
Can anybody point me at some sample code for accessing a calendar in Outlook. I need to access the calendar using the Win32 API not MFC as our programs are NOT written using MFC. I had a look around this site and MSDN but the only samples seem to be in either Visual Basic or MFC.
Thanks for any help you can give.
Steve.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Sounds like you need to learn about Extended MAPI. Not something that you can do in an evening. You do not need to use or know MFC, only how to use COM Interfaces.
|
|
|
|
|
Thanks for replying. The answer I was looking for involves the use of IDispatch interfaces. Once you've got one for the application you can lookup method ID's and then call those methods (passing parameters via an array of VARIANT's) I could have imported the outlook library (and made my life a lot simpler) but this ties you to a minimum version of Outlook.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
In my program I use the CPreciseTimer class twice in the same loop. Will they both work normal or will PreciseTimer1 stop if PreciseTimer2 starts?
Thanx,
kind regards,
Geert
|
|
|
|
|
Hello Everybody:
Lately I'm getting a windows message box that it says:
"Server Busy
This action cannot be competed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the probelm"
Then it has 3 buttons, one says Switch To, the other one says Retry and the last one is a disabled button that says Cancel.
This Server Busy message box doesn't show up constantly. It's happening when I call another application using another one. The code that I'm noticing the problem looks like this:
<br />
COleException *e = new COleException;<br />
CLSID clsid;<br />
<br />
if (CLSIDFromProgID(OLESTR("OtherApp"), &clsid) != NOERROR)<br />
{<br />
AfxMessageBox(IDS_ERR_LOOKUP_PROGID);<br />
return;<br />
}<br />
<br />
if (m_otherApp == NULL)<br />
{<br />
m_otherApp = new IOtherApp();<br />
if (m_otherApp == NULL) return;<br />
}<br />
<br />
if (m_otherApp->m_lpDispatch == NULL)<br />
{<br />
try<br />
{<br />
BOOL sts = m_otherApp->CreateDispatch(clsid, e);<br />
<br />
if (!sts)<br />
{<br />
throw e;<br />
}<br />
}
Is there a way to make that "Server Busy" message box go away? Anything is more than welcome.
Best regards,
Luis E. Cuadrado
)
|
|
|
|
|
Okay since I am using VC++ to develope this I will post this here
I am using the opacity feature to fade in and out my forms but I am wondering?!? Nayone know if fading can be done in directX and where I could find an example.
Thanks code brothers...
Lata.
Only nmap knows the way. The rabbit hole is never known only once is it all alone. To tell and know is the only way and find one of millions tomorrowday. You know it!
|
|
|
|
|
Hi
im trying to do a custom caption painter here , and have some problems with changing the height of the caption.
im intercepting the following messages:
WM_NCPAINT
even if i paint the caption here , the standard caption still shows when the window is animated
how should i make it render the caption when the window is minimizing / maximizing??
WM_NCACTIVATE
//occurs when the window is activated/deactivated so i guess it would be enough to just
draw the caption with the correct state when i get this mess , right??
WM_NCHITTEST
//dont really do much with this now
WM_NCCALCSIZE
i can change the size of the client area here , but how do i move the menu of the form?
it is still located directly under the caption , so if i would like to paint a larger caption
i would have to move the menu somehow, how should i do that??
and how could i move the min/max/close buttons?
//Roger Johansson
|
|
|
|
|
Take a look at this article customcaption.asp[^]
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Thanx , that was actually the first article i read about this kind of stuff.
i just cant figure out by that code , what decides where the menu will be located (????)
im actually doing this in c# , but i figure this would be a better forum since there are more c++ coders doing this kind of things than c# coders (i guess)
if i only resize the client area when i recive the WM_NCCALCSIZE
the caption actually get the size i want , and i can grab it and move it so i guess it works that far atleast.
but when i do this , i get no menu at all (i have a main menu on the form)
but if i call the default wndproc after i change the client size , the menu appears ,
the caption 'appears' to be the same size as i set it to be , but i can only grab the upper part of it and under that , the menu appears , kinda inside my caption.
so is there anyone who knows what decides the placement of the menu?
//Roger
|
|
|
|
|
What's Digital Signatur File Format(.p7s). How to read signature information from the file. pls guide me
Thanks in advance
Murali
|
|
|
|
|
hi for all....
i want to know what is the code to make program to send
message by using protocol " smtp "...
i want to make program can send message to some mails how i can do that????
(what the classes i must use???
.....etc);
thanks
amaal
|
|
|
|
|
;Phi,
see in cp at internet or network and you will see mnay examples on it...
cheers
Himanshu
|
|
|
|