|
...or search for std::autoPtr for C++ standard
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Is there any open source codes which can convert OpenGL rendering to HPGL format file?
|
|
|
|
|
Hi all,
I am registering a clipboard format as follows
UINT format = Registerclipboardformat(_T("FileName"));
then using the same format for setting the clipboard data
Setclipboarddata(format,hclipboarddata);
Now when i pass the file name to the handle, i could see in the memory location the path name is correct but after the execution of setclipboarddata command and after closing the clipboard when i see on the clipbook viewer, only drive letter is pasted.
Pl. answer to me ?
Thanks..
Vineet
|
|
|
|
|
In VC++ 5.0 through 7.0 creating a static library is no big deal. Any projects created can find the libraries quite easily. Now I need to use a specific library in a VC++.Net environment and am a loss as to how to.
I am a teacher at a community college and basically teach c++ console applications and the texts that I use currently contain a copy of VC++ 6.0 but our classrooms are fixed with VC++.Net
Any help would be helpful.
I am a new member and hope to submit this particular library that provides a sequre method for fetching keyboard data for all primitive types, strings and dates for console applications which obviate the not-so-secure cin.
DOC
|
|
|
|
|
|
I have an include fiel enums.h that houses off enums used
enum WordDirection
{
Right = 0,
Down,
Diag_Down,
Diag_Up
};
I have a class 'A'
private:
int _iRow;
int _iCol;
bool _bHighlight;
std::vector<cletter> _arrLetters;
WordDirection _enumDirection;
TCHAR _sWord[16];
now adding the include into the cpp seems fine. but the compile flips in the enum line of the include file and says "error C2011: 'WordDirection' : 'enum' type redefinition"
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
your file is being included more than once, so it's trying to create the enum more than once ( I reckon ). If you're using precompiled headers ( stdafx.h ), try including it in there and nowhere else in your project. The other thing is to put an inclusion guard block around your code so it will only include once. I think #pragma once is all you need to do this, at the top of the file.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need to close IE after starting IE with Createprocess. I am using ::PostMessage to try to close IE, but it is not working. I want to use Createprocess to start IE.
LPSTR szAPP = "c:\\progra~1\\intern~1\\iexplore.exe";
(CreateProcess(NULL,szAPP, NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo,&ProcessInfo));
Sleep(10000);
hWnd=FindWindow(_T("IEFrame"), NULL);
::PostMessage(hWnd, WM_CLOSE, NULL, NULL);
|
|
|
|
|
Why dont u use ExitProcess API to close it.
"I would luv to change the world, but they wont give me the source code"
My Articles
|
|
|
|
|
ZakAkili wrote:
hWnd=FindWindow(_T("IEFrame"), NULL);
Hi Mr Zak,
have you check for returned hWnd , may be it's NULL?
ZakAkili wrote:
::PostMessage(hWnd, WM_CLOSE, NULL, NULL);
Try WM_QUIT or pass ProcessInfo.hProcess returned from CreateProcess to TerminateProcess to closedown the IE
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Try:
LPCSTR szAPP = "c:\\progra~1\\intern~1\\iexplore.exe";
CreateProcess(NULL,szAPP,NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo,&ProcessInfo));
Sleep(10000);
TerminateProcess(ProcessInfo.hProcess, 0);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks, All of the replys have helped.
|
|
|
|
|
Hi Guys.
I was reading through one of Mike's articles on sockets. And I just CANT
seems to wrap my brain around this one:
BYTE* bp = (BYTE*)(&dataLength) + sizeof(dataLength) - cbLeftToReceive;
I got this far:
(Its a Byte)(Called bp) = (Point to Byte)(&WHAT?!?!) + Something?
Okay now I'm lost.. I simply dont get the (&dataLength), now Datalength
is just an int, so what with the (&int) what does it do?
What does the syntax here mean?
Somebody please help me out!
Shine
|
|
|
|
|
Mike who?
Which article?
Shining2005 wrote:
BYTE* bp = (BYTE*)(&dataLength) + sizeof(dataLength) - cbLeftToReceive;
BYTE* bp ==> bp is a pointer to a BYTE
(BYTE*)(&dataLength) ==> casting the address of dataLength to a BYTE pointer
+ sizeof(dataLength) ==> advance the BYTE pointer to the byte just past the end of the memory occupied by datalength
- cbLeftToReceive; ==> bring the pointer back cbLeftToReceive bytes
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hello gurus,
I'd like to know how I can convert a DWORD (32 bits) value into a byte array of four bytes (32 bits)?
<br />
DWORD dwLength=(DWORD) file.GetLength();<br />
BYTE length[4];<br />
length contains the value dwLength as a 4 bytes array.
Thanks
Best regards.
There is no spoon.
|
|
|
|
|
for (int i = 3; i >= 0; --i)
{
length[3 - i] = (dwLength & (0xff << (i * 8))) >> (i * 8);
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
DWORD dwLength=(DWORD) file.GetLength();
BYTE length[sizeof(DWORD)];
*(DWORD*) &length[0] = dwLength; Keep in mind that any code doing anything with the bytes will have to account for the endian type of the CPU.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hi,
Thanks
Actually I've found the following way:
<br />
length[0]=HIBYTE(HIWORD(dwLength));<br />
length[1]=LOBYTE(HIWORD(dwLength));<br />
length[2]=HIBYTE(LOWORD(dwLength));<br />
length[3]=LOBYTE(LOWORD(dwLength));<br />
which also works
There is no spoon.
|
|
|
|
|
Or how about:
BYTE *pLength = (BYTE*)dwLength;
pLength[0] will equal the low byte (assuming an intel machine)
What do you need this for?
|
|
|
|
|
It works, but not the same way as my code in my earlier post. Yours forces big-endian order. Which isn't wrong per se, it's just something to be aware of. Don't try to write that byte array out to a file and read it back in as a DWORD , for example.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hi
DWORD dwData=0x65A6;
BYTE arrDest[4];<br />
memcpy(arrDest,&dwData,sizeof(DWORD));<br />
|
|
|
|
|
|
Priyank Bolia wrote:
...but not good
Why? This is the method I've used in years past. I find it easier to read than a bunch of pointers ands casts.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I just write that thinking that people like it or not. I still use it in imaging programs, where image documents are large size and memory and speed are a constraint. It saves memory and helps out small programmers from the pointers nightmare, and the main point is it will save precious time as compare to for loops and memcpy operations etc.
http://www.priyank.in/
|
|
|
|
|
hello,
how can I compare two HTML files and know if there text contents has changed and highlight the changed parts.
|
|
|
|