|
I'm not going to be able to find anything specific but I am sure I have done something like that in the past without problems. The most obvious difference is that I would have used a Singleton Pattern[^] rather than a global. Perhaps you might give that a try.
|
|
|
|
|
The problem is that we cannot read the < and > in your code (and for templates, it is quite annoying). Please, replace them by the two symbols that are above the emoticons.
Now for your problem, can you give a better description of the exception ? What is the exact error ? When you use the debugger, where does it crashes ? The more info you provide, the more chances you'll get help.
|
|
|
|
|
Cedric Moonen wrote: The problem is that we cannot read the < and > in your code
This is one of my pet hates. It seems that no matter how many people complain about it or how often they do so, it has little effect.
Steve
|
|
|
|
|
I don't know if this pertains to your problem but I tried using std::vector<char> in a DLL and had to do the following:
template class __declspec(dllexport) std::vector<char>;
before using it.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
What is the best way to transfer some data from one PC to another in a LAN.
I have a IP address and a Port Number.
I used to send/receive data using sockets, many years ago, but if using Visual Studio 2005 C++ MFC Dialog application, could I have a good suggestion as to what component to use.
I assume that the data interface structure needs to be defined and aggreed; i.e. I could do this and send a copy to the s/w developer on the other PC.
Many thanks,
Andy.
|
|
|
|
|
|
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
|
|
|
|
|