|
You're so clever :]
Thankyou very much for your help. You've been quite informative
I've never fully understood converting from char 's to int 's, but you've cleared it all up for me
|
|
|
|
|
Sauce! wrote: You're so clever :]
Thank you.
Sauce! wrote: Thankyou very much for your help. You've been quite informative
I've never fully understood converting from char's to int's, but you've cleared it all up for me
You're welcome.
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
[My articles]
|
|
|
|
|
Sauce! wrote: if(lpCmdLine[n] == "-" && lpCmdLine[n+1] == "w")
...
if(lpCmdLine[n] == "-" && lpCmdLine[n+1] == "h")
lpCmdLine[n] is a single character, yet you are comparing to an array of characters (even though there is only one character present). You should use single quotes instead, like:
if (lpCmdLine[n] == '-' && lpCmdLine[n+1] == 'w')
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How to verify that calling process has read access to the specified range of memory in vista. Earlier IsBadReadPtr and IsBadWritePtr could be used. But it is not suggestible by Microsoft. Can I know any other alternate method to verify that calling process has access to memory
Thanks,
Venkat
|
|
|
|
|
In almost all cases the professional thing to do is crash. Why are you so insistent on implementing what is almost certainly a bad idea? We’ve had this discussion before. If you can give a compelling reason why your application is an exception I’ll give you some pointers, but I’m reluctant to be a part of the spread of bad programming practices.
Steve
|
|
|
|
|
I assume you just voted my reply down. If so, that's all well and good, but it doesn't change the facts. Again, see the following expert opinions on this issue:
Raymond Chen[^]: "You should crash."
Larry Osterman[^]
Steve
|
|
|
|
|
Hi friends,
The following code is giving the above error.
#include windows.h ;
#import msxml.dll ;
int main(int, char*[])
{
return 0;
} on vista.
I got a solution in msdn forums to replace the msxml.dll with msxml.tlb .Still i am getting the same error saying "Cannot open type library file: 'msxml.tlb':"
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=365059&SiteID=1[^]
Can someone tell me the reason for this.
Thanks in advance.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
Documentation for #import can be found here[^]. The following table is a quote from the section entitled "Search Order for filename":
Syntax form | Action | Quoted form | Instructs the preprocessor to look for type library files first in the directory of the file that contains the #import statement, and then in the directories of whatever files that include (#include) that file. The preprocessor then searches along the paths shown below. | Angle-bracket form | Instructs the preprocessor to search for type library files along the following paths:
1. The PATH environment variable path list
2. The LIB environment variable path list
3. The path specified by the /I (additional include directories) compiler option
|
This should be enough for you to fix the problem.
Steve
|
|
|
|
|
I have to write code for enabling DHCP using win32 API.can anybody help?I don't want WMI functions for this.Thanks....
|
|
|
|
|
|
Hellow
I made owner draw list view.
On the viusal studio emulator( Window Mobile 6 SDK ), it work well. I receive WM_MEASUREITEM & WM_DRAWITEM .
But on the device, No WM_DRAWITEM message come after I receive WM_MEASUREITEM,
Some part of my code is below
case WM_MEASUREITEM:
//OnListViewMeasureItem(g_hwndListView,(int)wParam,(LPMEASUREITEMSTRUCT)lParam);
lpmis=(LPMEASUREITEMSTRUCT)lParam;
lpmis->itemWidth=100;
lpmis->itemHeight=20;
return TRUE;
case WM_DRAWITEM:
OnListViewDrawItem((LPDRAWITEMSTRUCT) lParam);
return 0;
What's long with me?
|
|
|
|
|
When I compile a C project in VC++ .Net, this error is coming in a standard vc++ file "cerrno":
" error C2143: syntax error : missing '{' before ':'"
The code is as follows:
#if _GLOBAL_USING
_STD_BEGIN
#ifndef errno
using ::errno;
#endif /* errno */
How to solve this error?
Am I missing any SP for vc++ or something else?
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: #if _GLOBAL_USING_STD_BEGIN #ifndef errnousing ::errno; // <-- Compiler point error here #endif /* errno */
please check setting of VC++ .net complier, might be it using path of older version!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hi,
Thanks for your help, but I was available of original compiler this evening and finished compile on that!
But I will check your idea, when I will again work with VC++ for the same program.
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
How to check the path of the compiler?
In the new system where error happened, there was no VC++ .Net 2003 Toolkit installed.
I installed it now. Do I need to set this path to somewhere in compiler?
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Using VC++ .net, I am trying to compile a project developed in C on Linux.
In a header file below code is there:
typedef _Bool BOOL;
When compile the project, there is error message
"error C2061: syntax error : identifier 'BOOL'"
Project is a Win32 console project which includes a default c++ file and stdafx.h.
How to solve this error?
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
This error went after inclding "stdafx.h" in the header file.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: typedef _Bool BOOL;
remove this line, and try once more!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hi All,
I would like to ask regarding the possible overhead/performance issue for an application (DLL) to create an object (call NEW) and destroy the object (DELETE) every 1 second?
Thanks so much.
not so newbie
|
|
|
|
|
I dont think there will be any performance issue.
|
|
|
|
|
PSEUDOCODE
int *varArray[1000000];
StartNewTime = getSystemTimer();
for (i=0; i<1000000; i++)
varArray[i] = new int;
StartDelTime = getSystemTimer();
for (i=0; i<1000000; i++)
delete varArray[i];
endTime = getSystemTimer();
elapsedNewTime = StartDelTime - StartNewTime;
elapsedDelTime = endTime - StartDelTime;
timePerNew = (float) elapsedNewTime / 1000000.0;
timePerDel = (float) elapsedDelTime / 1000000.0;
Of course, if they were C++ objects that were calling constuctors & destructors, then the answer would be different, and you would need to have an array of 1000000 (or whatever other arbitrary number suits you) pointers to objects of the type to be investigated.
Just remember - if 1 event is too quick to time effectively, then just time a whole heap of them at once.
|
|
|
|
|
Anytime you employ the use of Windows' memory manager, there will be some overhead involved. It may be negligible, but there will be some.
Is it really part of your design to allocate and release memory every second?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ginjikun wrote: I would like to ask regarding the possible overhead/performance issue for an application (DLL) to create an object (call NEW) and destroy the object (DELETE) every 1 second?
could it don't by allocating static memory, instead of using dynamic memory. yes there could be dynamic issue, as memory allocation itself is tedious task.
how big is data??, could you code like this :-
if( MEMORY_REQUIRED > STATIC_MEMORY_ALLOCATED)
allocate DYNAMIC_MEMORY
else
use STATIC_MEMORY
now you have choose STATIC_MEMORY_ALLOCATED limits according to you.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Every 1 second is not very often relative to how many operations
can be done in one second by a modern PC. I can allocate/free hundreds of video
frame buffers a second using barely any CPU.
If your allocations are too slow (for reasons others have mentioned) then you can
implement some kind of pre-allocated memory scheme.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I try to print a window, using this article:
http://support.microsoft.com/kb/186736
It works, but I want to user default printer with landscape. So I try to modify the GetPrinterDC(), like this:
HDC CLogACTsPrintHelper::GetPrinterDC(void)
{
CWaitCursor wait;
PRINTDLG pdlg;
memset( &pdlg, 0, sizeof(PRINTDLG));
pdlg.lStructSize = sizeof(PRINTDLG);
pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
AfxGetApp()->GetPrinterDeviceDefaults(&pdlg);
DEVMODE* lpDevMode = (DEVMODE*)::GlobalLock(pdlg.hDevMode);
lpDevMode->dmOrientation = (short)DMORIENT_LANDSCAPE;
::ResetDC(pdlg.hDC,lpDevMode);
::GlobalUnlock(pdlg.hDevMode);
PrintDlg( &pdlg );
return pdlg.hDC;
}
But I don't know why it return NULL???
If I comment all source code in set landscape block, it works. Or if I do not use default printer and set landscape, it work
pdlg.Flags = PD_RETURNDC;
...
Can anyone explain me what's wrong here?
Thank you in advance,
|
|
|
|