|
Is this the right way?
LPVOID lpMsgBuf;
DWORD messageflags = FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY ;
DWORD retval;
//Format the message from the format string.
retval = FormatMessage(
messageflags,
OLE2T(formatstring),
NULL,
LANG_SYSTEM_DEFAULT,
(LPTSTR) &lpMsgBuf,
0,
(va_list*)&argsarray[0]
);
if (!retval)
return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError());
CComBSTR message;
message = T2OLE(LPTSTR(lpMsgBuf));
message.CopyTo(outputstring);
I modified LPTSTR lpMsgBuf; to LPVOID lpMsgBuf;
And converted LPTSTR to LPOLESTR.
Am i doing correct here? [Smile]
Regards,
Bala
|
|
|
|
|
the question is not about "message" variable how you clean up "outputstring" variable.
|
|
|
|
|
I wanna make a session logger program for different users working with my program(create a list buttons they click), this should be saved somewhere and later, it must be possible to read this info and create an excel report file from it.
How can I do it?
modified on Wednesday, May 7, 2008 2:49 AM
|
|
|
|
|
Yes it is possible, you need to add Excel com object in your program!
"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/codeProject$$>
|
|
|
|
|
|
there are 2 problems! The big problem is the first one, I don't have any idea how they log events and save them!
|
|
|
|
|
|
Hi,
I'm looking for a way to take a screen shot of a game from another process. I can get a screen shot of any normal application but the game uses DirectX and i have no idea how to do that . I searched the internet for a solution but i couldn't find any clue. All my attempts resulted in a black screen taken as screen shot which is normal due to that fact that the game doesn't render its images on screen but directly to the graphic card memory.
Any help regarding my problem is be appreciated.
Thanks
|
|
|
|
|
You can use
1. to hook DirectX
2. get address of graphics card and read bitmap in it
|
|
|
|
|
Interesting, do you know a resource about how to hook to directx and gain access to its surface buffer?
|
|
|
|
|
Have you tried printscreen when the game is running if so it would be possible in external application i think. probably you might have choosen wrong window handle to capture when in fullscreen. Have you tried to run the game in windowed mode.
Some Games have inbuilt feature for screen capture check that too.
|
|
|
|
|
Thanks for the fast reply,
The game responds to printscreen in full mode and saves a screenshot in JPG format in a directory, however printscreen works fine when it is windowed mode. I think this can solve the problem just when the game window has focus. My intention is to write a bot to control the game while running in the background. I think I'll need to access the game's screen while it is in the background. I wonder how that would be possible since the game might not render its screen at all. I have a feeling that i have to trick it into rendering or something like that
|
|
|
|
|
|
|
Hey everyone,
I create an empty dialog and add an activex control names ms flex grid 6.0. I create a class which inherited from CDialog and when I say create it fails and gives no information:
<br />
class CTry : CDialog<br />
{<br />
public: <br />
CTry ();<br />
};<br />
<br />
CTry ::CTry ()<br />
{<br />
if (!Create(DialogID))<br />
{ <br />
exit(-1);<br />
} <br />
};<br />
When I remove flex grid from dialog it suceeds...
I also know there was a liecense problem in design time with flex grid, but it says nothing when I am using it in design time
So any idea why this happens?
(Actually it happens when I try to add rich text box also.. seems like I cannot add an outside activex control)
Thanks everyone.
modified on Wednesday, May 7, 2008 1:31 AM
|
|
|
|
|
try initializing rich edit control with AfxInitRichEdit once in your application
BOOL <yourapp>::InitInstance()
{
AfxInitRichEdit( );
...
if you are not able to load flex grid,
try also, AfxEnableControlContainer() in InitInstance
|
|
|
|
|
I need to use Flex Grid, I just tried to use richedit also but didn't work.
So do you have any idea why flex grid didn't work??
here's code:
<br />
BOOL Appl::InitInstance()<br />
{<br />
AfxOleInit();<br />
thanks...
|
|
|
|
|
Have you tried the code which i given, because i tested AfxOleInit did't work but
AfxInitRichEdit for richedit control and AfxEnableControlContainer for Flex grid it worked.
|
|
|
|
|
Hey there,
I just tried AfxEnableControlContainer and it did work!
I didn't saw this code in your previous message, sorry for being careless
Thank you very much!
|
|
|
|
|
try adding AfxOleInit in your program! i believe in the InitInstance function of the Application!
"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/codeProject$$>
|
|
|
|
|
I have added the function but still did not work..
When I press test button on dialog, it works and seems ok.
got any idea???
<br />
BOOL Appl::InitInstance()<br />
{<br />
AfxOleInit();<br />
<br />
Works fine using AfxEnableControlContainer
Here's what msdn says about it:
If you did not enable ActiveX control support when you used AppWizard to generate your application, you will have to add this support manually. This article describes the process for manually adding ActiveX control containment to an existing OLE container application
modified on Wednesday, May 7, 2008 9:11 AM
|
|
|
|
|
sorry i confused between both of function
|
|
|
|
|
Helo,
I m writing win32 client socket using openssl.
my code for receive is like
static int lsSocketRecv(SSL* ssl, char* buf, int len)
{
int nRecv = 0;
char* p = buf;
int nRest = len;
do {
//nRecv = recv (sock, p, nRest, 0);
nRecv = SSL_read (ssl, p, nRest);
if (nRecv < 0)
{
printf("error");
}
}
when my control come to SSL_read(), it will blocks there only.
I mean control is not going ahead from SSL_read().
I already add all dependency regarding openssl and I m able to sucessfully connect with the server.
one more thing is that is there any way so that i can make it nonblocking mode in SSL.
Regards,
Amit
modified on Wednesday, May 7, 2008 2:13 AM
|
|
|
|
|
Dear All,
I am currently working on a C project.I need to port the code into Win Mobile 5.0 which is currently working in Win 32.I need to implement ctime( ),gmtime( ),strptime( ),localtime( ),mktime( ).Please help me to implement these in Win Mobile 5.0.
|
|
|
|
|
Wow! New user id? Cool. Please ask it in the Mobile Development forum, as I already said yesterday. Or is that you've asked it there too?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|