|
Whats the possibility to set some text to the memory and read the same text after a while but in the same process. If it is possible how can i accoplish this please explain me in detial.
I have tried with memset() and etc., but i couldnt see the desired output.
|
|
|
|
|
sivaprakashshanmugam wrote: Whats the possibility to set some text to the memory and read the same text after a while but in the same process. If it is possible how can i accoplish this please explain me in detial.
if i am not wrong , are you trying to keep the persistantancy of the data
if then try to use the static for persistancy.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Actually i am reading some text from file so it will be a stream of Bytes, i need to send bytes to MFC Activex control and i need to read it. I have tried in many ways but i couldnt so i am thought going this method. Do you have solution for this.
|
|
|
|
|
sivaprakashshanmugam wrote: Actually i am reading some text from file so it will be a stream of Bytes, i need to send bytes to MFC Activex control and i need to read it. I have tried in many ways but i couldnt so i am thought going this method. Do you have solution for this.
See,
You can read the file in text format you will get char string...
Convert that string into BSTR using ConvertStringToBSTR() function and
simply pass this bstr string to ActiveX control.
if you wanna a reflection on the BSTR then pass the pointer of it.
Another way is create the property of an Activex and set the string data to it read from file.
hope this helps you.
Knock out 't' from can't,
You can if you think you can
-- modified at 7:16 Friday 19th May, 2006
|
|
|
|
|
BYTE* p = NULL;<br />
<br />
BYTE* ReadFileIntoBuffer(...)<br />
{<br />
if(!p) { p = new BYTE[file_size]; }<br />
}<br />
<br />
bool PassToActiveXCtrl(...)<br />
{<br />
return ctrl.Input(p, file_size);<br />
}
Maxwell Chen
|
|
|
|
|
This is the method that i have used to transfer data between two different processes in one of my projects.
//In one Process(server)
<br />
HGLOBAL hMem;<br />
hMem = GlobalAlloc(0, (800*sizeof(char)));<br />
if(NULL == hMem)<br />
return;<br />
char* szVal = (char*) GlobalLock(hMem);<br />
<br />
memcpy(szVal, buffer, 800);<br />
if(!OpenClipboard(NULL))<br />
return;<br />
if(!EmptyClipboard())<br />
return;<br />
HANDLE hData = SetClipboardData(CF_TEXT , hMem);<br />
if(NULL == hData)<br />
return;<br />
if(!CloseClipboard())<br />
return;<br />
if(!GlobalUnlock(hMem))<br />
return;
//In the Second Process(Client)
if(!IsClipboardFormatAvailable(CF_TEXT))<br />
return -1;<br />
OpenClipboard(NULL);<br />
hgbl = GetClipboardData(CF_TEXT);<br />
char* szVal = (char*) GlobalLock(hgbl);<br />
char chScriptData[128];<br />
<br />
GlobalUnlock(hgbl);<br />
CloseClipboard();
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I am displaying an image using dib class . now i wish to flip my image horizontally as well as vertically
::StretchDIBits(pDC->m_hDC, // hDC
lpDCRect->left, // DestX
lpDCRect->top, // DestY
RECTWIDTH(lpDCRect), // nDestWidth
RECTHEIGHT(lpDCRect), // nDestHeight
lpDIBRect->left, // SrcX
lpDIBRect->top, // SrcY
m_pBMI->bmiHeader.biWidth,//RECTWIDTH(lpDIBRect), // wSrcWidth
RECTHEIGHT(lpDIBRect), // wSrcHeight
m_pBits, // lpBits
m_pBMI, // lpBitsInfo
DIB_RGB_COLORS, // wUsage
SRCCOPY); // dwROP
As per MSDN Documents i am changing the sign also but i am unable to get th desird result
Please if someone could help me out
I am new to vc++
-- modified at 6:26 Friday 19th May, 2006
|
|
|
|
|
have u tried this flag in your code?
DSTINVERT
-Sarath
|
|
|
|
|
No this is not helping by doing this i can see only the black box in the destination
|
|
|
|
|
|
Thanks a lot this solved my problem
|
|
|
|
|
|
I need to perform some IO routines (C programming under linux) and I realised many of these routines are in the file io.h but i do not know where could I get a copy of this file. I know that this file is free for distribution (The open source verison is free). Where do I get to download this header file? Any help or pointers in this direction is highly appreciated.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- Moved by Ed. at 9:33 Friday 19th May, 2006
|
|
|
|
|
Wrong forum - Please see the big red sign when starting a new thread in this forum that says quite explicity "No programming questions". Try an appropriate programming forum.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Sorry to have disturbed you. But, how did this become a programming question? I did not ask the C++ language commands to know how to open the usb port and get access to the buffer or anything. I just asked where would I get the file io.h
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: I just asked where would I get the file io.h
Yes I knew that you just need a URL to download that header file.
Maxwell Chen
|
|
|
|
|
Colin Angus Mackay wrote: Wrong forum
He is asking for some .h file, but he couldn't find a Linux programming forum on CP.
Maxwell Chen
|
|
|
|
|
Colin, he's just asking for a .H file, not trying to open an Excel file in VB or create a button in a datagrid.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
Thats not a programming question IMHO
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
|
|
|
|
|
Use <cstdio> if you are using a C++ compiler. All the C IO functions, in the std namespace.
Ryan
"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette
-- modified at 6:34 Friday 19th May, 2006, damn escaping
|
|
|
|
|
No sir, i am using C compiler and the header file that i am looking for is not there.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Odd, should be under /usr/include somewhere. Can't get far without the standard C lib in UNIX.
Ryan
"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette
|
|
|
|
|
it can be somewhere weird, like /usr/include/asm-i386/, otherwise you may find it in <linux kernel="" headers="">/include/asm-i386
|
|
|
|
|
Here you can get the file[^]
under linux the file is present at
/usr/include/asm/
Knock out 't' from can't,
You can if you think you can
-- modified at 9:44 Friday 19th May, 2006
|
|
|
|
|
How to convert ASCII value to character. Meaning im reading data from device it gives 65 insted of 'A'. how can i get my data back in VC++.Net.
|
|
|
|