Yes, it is the same. The parenthesis are here just useless.
But, there's a difference between return; and return 0;: the first one is used in a function that returns nothing (void) and the second in a function that returns something (here, probably an integer).
Yes, exactly the same. The addition of brackets makes no difference.
This however is totally different, and only valid in a "void" function - i.e. one which doesn't return a result.
The difference between them can be illustrated as :-
int DoSomething_1(int val)
// some processing
return (0); // has to return a value as it's an "int" function
void DoSomething_2(int val)
// some processing
return; // must not return a value as it's a "void" function
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
To build a solution, you can simple pass in the path to the solution file and optionally a configuration, such as debug or release. Projects are compiled by using the Project switch, and you can build one project at a time, also optionally specifying the configuration to use.
We have several exes that need access to common dialogs for database administration on common tables. Dialogs need access to a database via ADO/ODBC and user interface. We have in the past recreated the same dialog repeatively. Getting tired of doing that. Would like to create for each dialog an EXE/DLL or something that we can link at runtime in case of changes. A DLL looks like the best way. Any BOOKS or PUBLICATIONS out there to exactly guide us from creating , calling from current EXEs, and distribution? Really need step by step not just a reference document. Would just creating an EXE for each dialog and shell execute would work? Pros / cons.
(If you're using MFC) We had a similar problem, and eventually, after lots and lots of deliberation, we opted for a non-portable solution, where the DLL with the dialogs export the entire CDialog classes, using the __dllexport keyword in the class declaration. Code won't be reusable by any other platform or compiler, but it works... You could pass in a CDatabase or what have you to the dialog constructor.
Hello, I'm having a very difficult time changing parameters using code to a program that has a few labels. I was able to move their position, change their color, but unfortunately not their sizes. This project also uses ActiveX. I'm using VS 2008, and the only articles that give any insight are all for VS 6.
now this is where i've been hitting a very bad wall
this is the method i've been tackling.
memset(&lf, 0, sizeof(LOGFONT)); // zero out structure
lf.lfHeight = 12; // request a 12-pixel-height font
strcpy_s(lf.lfFaceName, "Arial"); // request a face name "Arial"
VERIFY(font.CreateFontIndirect(&lf)); // create the font
the error i'm getting is "error C2664: 'CLabel::SetFont' : cannot convert parameter 1 from 'LOGFONT *' to 'LPFONTDISP' " I've done all the research i could do to properly troubleshoot this, but unfortunately i've hit the point where i need professional help. m_lblctrl1 is defined as a CLabel in case that helps. Also i used Do Data Exchange from the original label defined:
DDX_Control(pDX, IDC_LBLCTRL1, m_lblctrl1);
If anyone has experience with this LPFONTDISP and how to change the label size/font, i'd greatly appreciate help.
Thank you for any input, if there is any details i left out, I'd gladly add it.
I'm having a hard time getting the exgrid.dll to work, their examples give me a lot of errors. This was more for VS 6 i'm using 2008. I don't know if this would make a difference, i downloaded the file, but haven't had much success. Other suggestions would be greatly appreciated!
Saving a pointer doesn't make any sense. A pointer is merely a memory address, how useful would that be ?
What you probably want to do instead is save the content of your object to the file. In that case, you will need to save each member variables separately.
I suggest you take a look at this article[^] (and the full series) to have a better understanding of serialization.
Usually, that make no sense: a pointer contains the address of an object, so what is the purpose of storing it? If you need to store the class instance (i.e. the object itself) then you should look at serialization (Serialization on Wikipedia, Serialization in MFC).
Ah, of course the size of the pointer pClass is
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
char *strtok( char *str1, const char *str2 ); char str = "now # is the time for all # good men to come to the # aid of their country";
char delims = "#";
char *result = NULL;
result = strtok( str, delims );
while( result != NULL )
printf( "result is \"%s\"\n", result );
result = strtok( NULL, delims );
for char str , how can i assign it to a variable b? so far i get this error:
readin.cpp:34: error: initializer fails to determine size of ‘str