|
Thx for you answer !
I thought to this solution but i can't get all pixel state od the page only those there are display. So for me it is a problem
|
|
|
|
|
What do you need to get the pixel state for? There may be another way to solve your problem (without getting the pixel state).
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I am trying to make a dll for the images in my project. In the dll's project I add the resources (bitmaps) and I have functions to return HICONs, HBITMAPs, etc.
But I can't create any image resources in my dll.
In my resource.h I have
#define IDB_02 5001
but when I do
CBitmap dd;
BOOL ret = dd.LoadBitmap(IDB_02));
"ret" is false. Do I have to include something else in a dll to make it work with images?
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Before you call this, call AfxSetResourceHandle() to set the location of the resource, remembering to save the old one using AfxGetResourceHandle()
HINSTANCE hOldRes = AfxGetResourceHandle();
AfxSetResourceHandle(hinstDLL);
CBitmap dd;
BOOL ret = dd.LoadBitmap(IDB_02);
AfxSetResourceHandle(hOldRes); Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I performed format function by calling the following function in shell32.dll:
(* dl_SHFormatDrive)(hWnd,cDrive-'A',SHFMT_ID_DEFAULT, bQuickFormat?:SHFMT_OPT_FULL);
My project can pop up a format dialog to format the floppy disk.
Now I want to hide the format dialog and let my floppy disk be formated automatically, in addition, I want to know the real-time value of ProgressBar's position. How can I handle this problem?
Please help me!
Thank you!
|
|
|
|
|
Have a look at the book "Visual C++ Windows Shell Programming" by Dino Esposito (Wrox Press). It's probably out of print but you should be able to get it still. Chapter 10 covers exactly this.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Do you know where I can download those contents?
Thank you!
|
|
|
|
|
You can't legally download the book - it's copyrighted.
You can download the code examples that go with the book from http://www.wrox.com/dynamic/books/download.aspx[^]. Scroll to the bottom of the page and choose the book title.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
You are so kind!
I appreciate your help very much!
Thanks
|
|
|
|
|
Hi all,
I have a problem with an acknowledged MSDN Bug - being... using sockets in a multithread program. SP5 supposedly fixed the bug (?) but I still get asserts when using either version of the VC++ Debug libraries.
Is there new Debug libraries available or can I just modify the sockcore.cpp file and rebuild it ?
cheers
Will Beattie
whybotha69@hotmail.com
|
|
|
|
|
You can rebuild the MFC source files (there is info in MSDN on how to do this properly), but it might be easier to try to work around the bug. Did the KB article give information on how to work around the bug?
Just a tip. If you do rebuild the source files, don't put the new version in your Windows/System folder - other programs may break because of the fix. The same goes for the Release version if you rebuild that as well. If you have to distribute a modified version of the MFC library, store it in the same folder as your program.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan,
I have done heap of hunting on this problem which basically boiled down to creating a Socket in one thread and then trying to use it in another thread.
MFC does not allow sockets to be passed between threads or so it appears. I don't know if this is a bug as suggested by their bug fix "Q193101"
"SYMPTOMS
When using MFC sockets in secondary threads in a statically linked MFC Visual C++ 6.0 application, an unhandled exception occurs.
CAUSE
The reason for the unhandled exception is that an object of type CMapPtrToPtr pointer, pointed to by m_pmapSocketHandle, is never created."
I will keep trying.
cheers
Will Beattie
|
|
|
|
|
whybotha69 wrote:
MFC does not allow sockets to be passed between threads or so it appears. I don't know if this is a bug as suggested by their bug fix "Q193101"
No other MFC object that relies on a Windows HANDLE can be passed between threads, so I assume sockets are the same, ie. I believe this is the correct behaviour, not a bug.
The KB article only shows how to prevent the unhandled exception error that occurs. It doesn't say that sockets can be used in multiple threads. I'm certain that a MFC socket can only be used in one thread.
Did you try their solution to prevent the error?
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi Ryan,
Yes I tried their fix .. no luck. My code works as required in Release but Asserts when in Debug mode.
As to MFC Sockets and multithreading the jury is undecided. This article has a section near the bottom called "CSocket Objects and Multithreading".
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarpic/html/msdn_wsockets.asp
Thanks Will
|
|
|
|
|
whybotha69 wrote:
creating a Socket in one thread and then trying to use it in another thread.
Hi, I hope you know that in order to use the MFC's socket object between two threads you should do a Detach() on the object which will give you a handle of type SOCKET, and then Attach() using that handle in the other thread. Which is basically:
- Call Detach() on the object in order to obtain the SOCKET handle
- Delete the detached object
- Create the (CSocket or CAsyncSocket) object in the second thread
- Attach the SOCKET handle to the newly created object using Attach()
The bug mentioned in Q193101 is not about this exactly, it's about creating and using sockets objects in secondary threads.
|
|
|
|
|
Im new to C++ i wanna teach my self, anyone got any tutorials that a simple to understand but also quick to learn and usful tutorials, coz im looking into making a mod for a game, so i need to know code in that area
cheers
ps i dotn care what version of Microsoft C++ it is
Half Life 2 Modification:
New Dawn 0.01% Complete
|
|
|
|
|
|
Is it possible to:
LPDIRECTDRAWSURFACE lpSpriteSurface[];
Then as the region map dictates that a certain creature type is in the area...
Check to see if the pointer is valid...and if not, create it and load it with the frames of animation required by that creature type.
If the pointer is valid, then just return it to the SpriteManager as that sprites source surface.
Do I have to dictate the number of array elements ?
LPDIRECTDRAWSURFACE[MaxNumberOfSpriteSurfaces];
and then initialise them ?
for (int i=0; i
|
|
|
|
|
Anonymous wrote:
Is it possible to:
LPDIRECTDRAWSURFACE lpSpriteSurface[];
No, you will need to specify the size, however you can use a vector to track these as you create new LPDIRECTDRAWSURFACE objects. To do it as you have listed you would also have to use {} to specify the values of the individual objects prior to your semi-colon.
-Nick Parker
|
|
|
|
|
The size of an array must be known at compile time, so this is ok
LPDIRECTDRAWSURFACE lpSpriteSurface[MaxNumberOfSpriteSurfaces];
if MaxNumberOfSpriteSurfaces is a constant or #define.
--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
i know that using netmessagebuffersend api can do it in windows NT/2000/XP.
but how can i do that in windows 98?
thanks.
Thanks for reply!
|
|
|
|
|
http://www.codeproject.com/useritems/FakeSend.asp[^]
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
thank you.
and i have done it!
|
|
|
|
|
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I have displayed Unicode strings in CEdit derived controls successfully but now when I want to display the same string in a CRichEdit control, it displays a '?' character for each unicode character. I think richedit control takes only ascii characters by default.
Is there any way to let rich edit control accept unicode strings.
I can't even copy the string from edit control and paste into the richedit control. It still displays alot of '?' characters.
Example:
<br />
wchar_t strUnicode[10];<br />
strUnicode[0] = 0xfebd;<br />
strUnicode[1] = '\0';<br />
<br />
GetEditCtrl().SetWindowText (strUnicode);
<br />
GetRichEditCtrl().SetWindowText (strUnicode);
|
|
|
|