|
u0m3 wrote: winampLong = GetWindowLong(winampHWND, 0);
Did you just make this up? 0 is DWL_MSGRESULT.
u0m3 wrote: lpWndProcOld = (WNDPROC)SetWindowLong(winampHWND, GWL_WNDPROC, winampLong);
lpWndProcOld = (WNDPROC)SetWindowLong(winampHWND, GWL_WNDPROC, (LONG) &MainWndProc);
|
|
|
|
|
I started using this code for subclassing the main window: http://forums.winamp.com/showthread.php?s=&threadid=227006
Here's the relevant part:
int init()<br />
{<br />
lpWndProcOld = (WNDPROC)SetWindowLong(plugin.hwndWinampParent,GWL_WNDPROC,(LONG)WndProc);<br />
<br />
HWND pe = (HWND)SendMessage(plugin.hwndWinampParent,WM_WA_IPC,IPC_GETWND_PE,IPC_GETWND);<br />
lpPEProcOld = (WNDPROC)SetWindowLong(pe, GWL_WNDPROC, (LONG)PlaylistEditorProc);<br />
<br />
return 0;<br />
}
I used only the first part...
lpWndProcOld = (WNDPROC)SetWindowLong(plugin.hwndWinampParent,GWL_WNDPROC,(LONG)WndProc);
I got errors for plugin and (LONG)WndProc -> don't know how to get them... sorry... I'm a n00b.
|
|
|
|
|
hfry wrote: lpWndProcOld = (WNDPROC)SetWindowLong(winampHWND, GWL_WNDPROC, (LONG) &MainWndProc);
What is MainWndProc? Or more importantly, how do I get it?
|
|
|
|
|
It's your window procedure...
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
|
I have a fairly large application (MFC App) developed in Visual C++ 6.0.
As it's growing constantly, it's getting bigger and bigger and I've started to modularize it by adding DLLs with Visual Studio 2003 and now Visual Studio 2005.
Is there a better method nowadays that I can use to add new modules to the app or is DLL still the classic method used ?
Thanks.
|
|
|
|
|
vcpp_cgr wrote: is DLL still the classic method used
Pretty much the same, except that it's called assembly in the context of .NET Framework.
Best,
Jun
|
|
|
|
|
How can I recieve HBITMAP from clipboard? In both cases I;m getting empty bitmap:
1. HGLOBAL hMem = GetClipboardData( CF_BITMAP );
HBITMAP hBitmap = (HBITMAP) GlobalLock( hMem );
2. HBITMAP hBitmap = (HBITMAP) GetClipboardData( CF_BITMAP );
And second question:
how can I then create CBitmap object from HBITMAP?
Thanks for any help
~~~~
|
|
|
|
|
HBITMAP handle = (HBITMAP)GetClipboardData(CF_BITMAP);
CBitmap * bm = CBitmap::FromHandle(handle);
Do the chickens have large talons?
|
|
|
|
|
Then I need to draw this bitmap from clipboard. How can I select it for device context, to draw it on the screen?
This code isn't working:
CDC dcTmp;<br />
dcTmp.CreateCompatibleDC( pDC );<br />
<br />
HBITMAP handle = (HBITMAP)GetClipboardData(CF_BITMAP);<br />
CBitmap * bm = CBitmap::FromHandle(handle);<br />
dcTmp.SelectObject( bm );<br />
<br />
pDC->BitBlt( 0,0,uWidth,uHeight, &dcTmp, 0,0,SRCCOPY );
~~~~
|
|
|
|
|
Please somebody help me
~~~~
|
|
|
|
|
Code:
#include <iostream>
#include ".\PrimeGen.h"
using namespace std;
void main ()
{
CPrimeGen PrimeRange1(1,1000);
int iCountPrimes = 0;
for (int iCount = 1; iCount = 1000; iCount++)
{ if (PrimeRange1.PrimeNumber[iCount] == true)
{iCountPrimes ++;}
}
cout << iCountPrimes;
}
class CPrimeGen
{
public:
CPrimeGen(int iUpperBound);
CPrimeGen(int iUpperBound, int iInterval);
CPrimeGen(int iLowerBound, int iUpperBound, int iInterval);
virtual ~CPrimeGen();
bool isPrime (int iNumber);
bool *PrimeNumber; // array of PrimeNumbers
};
Jon
|
|
|
|
|
which symbol is unresolved ?
Do the chickens have large talons?
|
|
|
|
|
Test1 error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
Test1 error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
Any ideas?
Jon
|
|
|
|
|
You are providing too little information. However, I would guess that you are missing a multithreading library. Make sure you are linking with multithread libraries.
Mutithreaded libraries are "LIBCMT.LIB" (release) and "LIBCMTD.LIB" (debug). However, I find it strange that the MFC is the one requesting the presence of "_beginthreadex" or "_endthreadex". This probably means you are not linking against MFC base libraries.
Anyway, try to link with the multothreaded libraries and see what you get. If it doesn't work then try to provide more information on the project settings (kind of project, compiler settings, linker settings, ...).
I hope this helps,
Rilhas
|
|
|
|
|
Hello,
I'm trying to program a few exception classes for use in some software I'm working on. I'm more familliar with Java style of exception programming, and am having trouble finding some good API documentation on C++ exception classes. My plan was to inherit from exception, or runtime_error, however I can't find figure out what methods I'm inheriting without a good API. Does anone know of a good API page on the exeption classes?
Thanks.
Patrick
|
|
|
|
|
|
Thanks for the link, that puts me on the right trak; however, considering the following example:
<br />
#include <iostream><br />
#include <exception><br />
using namespace std;<br />
<br />
class myexception: public exception<br />
{<br />
virtual const char* what() const<br />
{<br />
return "My exception happened";<br />
}<br />
} myex;<br />
<br />
int main () {<br />
try<br />
{<br />
throw myex;<br />
}<br />
catch (exception& e)<br />
{<br />
cout << e.what() << endl;<br />
}<br />
return 0;<br />
}<br />
This example does part of what I'm looking for, however I'd like to have more options when using the exception class. I'd like to give the programmer the option of passing in their own error message to the exception class, or to just use the default. Anyone know where I can look fir this?
Thanks.
Patrick
-- modified at 16:47 Thursday 13th July, 2006
|
|
|
|
|
pgav wrote: Anyone know where I can look fir this?
What Joe Woodbury said is correct. The C++ base exception class only defines what() so unless you want to use that you can just create your own base exception class to your own design requirements.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
With C++ exceptions, you can throw any object, even an int if you feel like it. There is no base exception class. (STL has an exception class, but it's very limited.)
I STRONGLY suggest writing your own exception class and write it to fit your requirements.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi,.....hhow can v load any movie clip in opengl?....`i have seen the tutorial in nehe..but it is not going wid the program i have developed..not showing the animation of the movie instead showing conflicts with already made tecxtures GL_TEXTURES_2D..how can v resolve dis?
Regards
NooR
|
|
|
|
|
In the OnAccept() handler you need to accept the incoming socket.
|
|
|
|
|
Hi any1 can help me how do i can make the curve mountain area in my game terrain...
Thx Regards
NooR
|
|
|
|
|
|
yup using OpenGl...n in tool visual C++..how can i do dis..make the curve shape of mountains making its textures>.....
NooR
|
|
|
|
|