|
|
I can't say what the best way is for your application, but here's a description of some of the
methods available with Windows:
Interprocess Communications[^]
Given an IP and a port number (which combined, nicely defines a complete socket address)
I'd say sockets is a good option.
Regardless, both ends generally (always?) need to agree on the protocol.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, it's me... again
I've now added GDI+ to an existing application, to allow the display of TIFF images (and other reasons). So the old "OleLoadPicture" and the IPicture have to be replaced.
I've a global var as a buffer for the image:
Gdiplus::Image *m_image;
I display the image with this code:
graphics.DrawImage(&m_image, x, y, size_x, size_y);
When I load a test image this way, it works (= it is displayed):
Gdiplus::Image m_image(L"testSMALL.TIF");
But of course I have to replace the old code, where the image is save out from a stream with the help of OleLoadPicture. I tried it this way:
LPSTREAM pstm = NULL;<br />
HRESULT hr = CreateStreamOnHGlobal(hGlobal, TRUE, &pstm);<br />
if (SUCCEEDED(hr) && pstm)<br />
{<br />
Gdiplus::Image m_image(pstm);<br />
}
But it won't compile this way. It says it has an error at the line where the "DrawImage" is:
error C2664: 'Gdiplus::Status Gdiplus::Graphics::DrawImage(Gdiplus::Image *,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL)': Konvertierung des Parameters 1 von 'Gdiplus::Image **__w64 ' in 'Gdiplus::Image *' nicht möglich
-> in english: cannot convert the first parameter 'Gdiplus::Image **__w64 ' in 'Gdiplus::Image *'
And please don't bash me, I know that I don't have a clue about C++
Thx and Greets, Shi
|
|
|
|
|
See the double * in the error message? If you look at the start of it, the function expects the first parameter to be of type Image* , and you are passing it &m_image , and since m_image is already a pointer (its type is Image* ), you are passing the function the address of a pointer (a pointer-to-a-pointer).
Change the first parameter from &m_image to just m_image .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
What happens if you run this code
graphics.DrawImage(m_image, x, y, size_x, size_y);
instead
graphics.DrawImage(&m_image, x, y, size_x, size_y);
|
|
|
|
|
then it works!
Thank you very much. All of you.
|
|
|
|
|
|
Hello,
Is there a way to open an explorer folder, for example C:\myprojects, inside a tabbed window of IE7; so I can save screen realestate? Because currently, when I type in "c:\myprojects" in address bar of from a new tab in IE7 it opens up a Explorer folder outside of IE7. Why not, doesn't explorer and ie7 use same underlying browser? if this is not possible how can I write a small C++ progie to do this for me? I know, microsoft will steal it and package it under WGA but it would be a nice convenience.
JavaME (J2ME), Java, C & C# Developer
CV: http://docs.google.com/Doc?id=dt6fqcn_51dn8gds
|
|
|
|
|
I use a browser called Opera. It is an excellent browser and solves your problem, allowing you to view folders in an explorer-style manner. Download it from http://www.opera.com/download/
It was also one of the first browsers to implement tabbed windows.
Hope this helps!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|
|
No, this will not help me. Neither Opera nor Firefox will work because my companies website is not compatible with them.
BTW: I also use Opera
Thanks
JavaME (J2ME), Java, C & C# Developer
CV: http://docs.google.com/Doc?id=dt6fqcn_51dn8gds
|
|
|
|
|
Well it SHOULD be compatible with them
It seems like the Internet revolves around Internet Explorer.. which so happens to be the worst browser out there..
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|
|
hi
Is it possible to add check to for each tree items in CTreeCtrl instead of all
EmptyBox
|
|
|
|
|
The check boxes in trees and list controls are done by creating an image list. The image list is applied to every item in the same manner.
To get check boxes for individual items, you cannot use this feature. Instead, create your own image list for the blank (no checkbox), empty check box and filled checkboxes, and whenever you insert an item into the tree, set the appropriate image to check box or no checkbox.
It does mean, though, that you will need to process NM_CLICK to 'toggle' the check state by updating the item's image accordingly.
|
|
|
|
|
hey Jason, you are so clear, thx for your reply
|
|
|
|
|
Hi guys
I want to stop Autorun through my Application.
Thanks in advance
RYK
|
|
|
|
|
VC_RYK wrote: I want to stop Autorun through my Application.
. Didn't get anything from your query. Can you explain more?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i want to stop AutoPlay of CD as well as USB storage Device by my Application.(as AutoPlay runs while running my Application then AutoPlay will be stoped or canceled)
|
|
|
|
|
Are you not wanting your application to run via the "auto run" feature of the CD? If so, then how are you wanting it to run?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think you have to set the key
HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Policies/Explorer/NoDriveAutoRun
to 0xFFFFFFFF
-- modified at 13:16 Wednesday 29th August, 2007
I think you have to restart the PC after that the value is changed,...and it could be a problem remember to restore the old value when close.
So:
you can use the message WM_DEVICECHANGE sended from a driver when a device is inserted.
Russell
|
|
|
|
|
|
Guys,
I have a question concerning blitting to a DirectDraw7 surface using Blt. My objective here is to take the source surface, lets call it XYSurface, and blit it back onto itself, simply rotating it during the blit. Can I do something like this?
<br />
LPDIRECTDRAWSURFACE7 pXYSurface;<br />
RECT rc;<br />
GetClintRect(hDlg, &rc);<br />
<br />
hRet = pXYSurface->Blt(&rc,pXYSurface,&rc,DDBLT_ROTATIONANGLE,&ddbltfx);<br />
<br />
if(hRet != DD_OK)<br />
{<br />
HandleDDErrors(hRet, errorMessage);<br />
MessageBox(NULL,errorMessage,"Error",MB_OK);<br />
return -1;<br />
} <br />
When I do this, hRet is DDERR_SURFACEBUSY. Which reveals that "Access to the surface is refused because the surface is locked by another thread." Is this because I am trying to Blit back on to the source?
Thanks,
Joe
|
|
|
|
|
Hello Friengs,
Yes yes I know there is a function called GetCurrentProcessID(),which returns the process ID of current Process.
But the problem is I am creating to many processes(like notepad ) and i want to know currently on which process the user is working.I tried the above function but it gives me different process Id.Now i dont know what to do.
|
|
|
|
|
AfxBeginThread return the CWinThread object pointer.
And that class contains the member CWinThread::m_nThreadID .
It helps?
Russell
|
|
|
|
|
Gaurang Shah 033 wrote: ...which process the user is working.
Please explain further.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It's a member of the PROCESS_INFORMATION struct that you passed in a call to CreateProcess()
|
|
|
|