|
Hi, I want to know how can i add 2 CRecordset Derived class to my application.. I tried to 2 CRecordset class to my application, but when i make pointers to these classes. It gives me runtime error.. Anyone can help me with that??
I just want to open 2 CRecordset classes and each one point to only 1 table. So i can control them sepeartely... Thanks!
|
|
|
|
|
Recently i have gotten into making windows only using CreateWindow and CreateWindowEx functions, no MFC or any other classes, i find that its kinda hard to find code examples that design the windows this way, most use dialogs, designed in the VC++ IDE, or MFC
can anyone point me to some articas or web-sites with code examples that only use CreateWindow(Ex) to make its windows, and controls?
and also, i design my windows for 95/98/ME, and controls that are near the bottom, are very close or past the bottom of the window when the program is run on XP, this is due to the size of the Title Bar/Caption Bar (whatever you want to call it) so is there someway i could adjust this?
|
|
|
|
|
»Archer282« wrote:
is there someway i could adjust this?
AdjustWindowRect(Ex)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
»Archer282« wrote:
no MFC or any other classes,
I'm curious - why? You stand to gain in terms of reduced development time and increased stability by using MFC (or an equivalent) class library.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
smaller file size, less dependecies, unlike some people i like the "more coding" part
|
|
|
|
|
if this is a commercial application that you have to support you will soon get over the joy of "more coding"
If you just doing it for fun then go for it
|
|
|
|
|
Ravi Bhavnani wrote:
increased stability by using MFC
I would have to disagree
How do I print my voice mail?
|
|
|
|
|
I recently downloaded the TODO files and compiled it, but received an error regarding missing file "htmlhelp.h". Where do I retrieve this file so I can run the application?
Mavin
|
|
|
|
|
You should post your question in the local forum of the subject article.
|
|
|
|
|
Do you know any good articles about storing some dialog values in registry ?
|
|
|
|
|
Check out the MSDN Documentation on the functions
http://msdn.microsoft.com/library/en-us/sysinfo/base/regcreatekey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regdeletekey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regopenkey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regsetvalue.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regqueryvalue.asp
if you need help understanding how to use these functions just post again or ask me on msn(archer282@msn.com)
|
|
|
|
|
|
Hi all.
I have a worker thread that calls InternetConnectAttempt() to connect to the internet. At the same time my primary thread has a modeless status dialog that contains a cancel button. What I want to have happen is that when a user clicks the cancel button on the status dialog, the network connection/dial-up dialog that is displayed via the InternetConnectAttempt() call is also canceled.
What I have in my secondary thread is:
m_bIsDialing = TRUE;
Status = Code_That_Calls_InternetAttemptConnect_And_Returns_Status();
m_bIsDialing = FALSE; And in my primary thread I have
void CXXXXX::OnUserPressedCancel()
{
if (m_bIsDialing)
{
CWnd *pDialer = CWnd::FindWindow(_T("#32770"), _T("Dial-up Connection"));
if (pDialer && IsWindow(*pDialer))
{
pDialer->PostMessage(WM_CLOSE);
pDialer->PostMessage(WM_CLOSE);
}
}
} Now I tried this code on the client's laptop computer running XP that he connects to the internet via a cable connection. We were in a restuarant so it was not connected. The problem is that the connection dialog that came up was entitled "Network Connection" (or some such), and I was looking for a dialog entitled "Dial-up Connection".
I would like a clue on one of these two questions:
A.) Is there a better way than using FindWindow to get the window handle to the dialog that pops up when a call is made to InternetConnectAttempt() ?
B.) Can some one give me a list, or tell me where to find such a list, of all the possible dialogs that can or will pop up when InternetAttemptConnect is called? That way I can use that list to build a search algorithm using FindWindow .
Thanks
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
Is there a better way than using FindWindow to get the window handle to the dialog that pops up when a call is made to InternetConnectAttempt()
You could try setting a CBT hook just before the call to InternetAttemptConnect(). This is what MFC does to map HWNDs to CWnds. Then store the HWND so you can use it later. You could test the class name if you know it doesn't change, or even check some of the controls in the dialog box.
Ryan "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"
|
|
|
|
|
Yeah, that might work. I could set up the hook to catch any window creation routine. The problem comes that I do not know which windows will be created. I do not know their class names or their window captions. What should be consistant though is the process ID (at least according to spy++, Window Properties, Process tab, Process ID). I know that there will be only one visible top level window created by my app when I call InternetAttemptConnect but there may be others created by other apps.
So I guess my next question would be how would I go about getting the process ID of the window???
<EDIT>GetWindowThreadProcessId() will do the trick</EDIT>
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
So I guess my next question would be how would I go about getting the process ID of the window???
<edit>GetWindowThreadProcessId() will do the trick
That's one way, although when the hook is called, the window has not been created yet, so it probably won't work. The other way is that because the hook procedure is called in the context of the process/thread creating the window, GetCurrentProcessId() will give the process ID of the window the hook is called for.
Ryan "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"
|
|
|
|
|
Actually, it does seem to be working
MSDN[^] says "At the time of the HCBT_CREATEWND notification, the window has been created" so calling GetWindowThreadProcessId returns the correct window handle to the dialup dialog.
Thanks for the tip
In the dll:
HINSTANCE hInst = 0;
HHOOK hook = 0;
HWND hWnd = 0;
DWORD ProcessID = 0;
static LRESULT CALLBACK CBTHook(int, WPARAM, LPARAM);
__declspec(dllexport) BOOL SetDUDWCHook(DWORD _ProcessID)
{
if (!hook)
{
hook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHook, hInst, 0);
if (hook)
{
ProcessID = _ProcessID;
return TRUE;
}
}
return FALSE;
}
__declspec(dllexport) void ClearDUDWCHook()
{
if (hook && UnhookWindowsHookEx(hook))
{
hook = 0;
hWnd = 0;
ProcessID = 0;
}
}
__declspec(dllexport) void KillDUD()
{
if (hWnd && IsWindow(hWnd))
{
PostMessage(hWnd, WM_CLOSE, 0, 0);
PostMessage(hWnd, WM_CLOSE, 0, 0);
ClearDUDWCHook();
}
}
static LRESULT CALLBACK CBTHook(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HCBT_CREATEWND && !hWnd)
{
HWND Window = (HWND)wParam;
CBT_CREATEWND *pCW = (CBT_CREATEWND *)lParam;
DWORD Process = 0;
GetWindowThreadProcessId(Window, &Process);
if (Process == ProcessID)
hWnd = Window;
}
return CallNextHookEx(hook, nCode, wParam, lParam;
}
In the my program I call SetDUDWCHook() before InternetConnectAttempt() and ClearDUDWCHook() after. If the user presses the "Stop" button I call KillDUD(). Works like a charm. Thanks again.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
Actually, it does seem to be working
MSDN[^] says "At the time of the HCBT_CREATEWND notification, the window has been created" so calling GetWindowThreadProcessId returns the correct window handle to the dialup dialog.
Learn something new every day
Glad to be of help
Ryan "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 doing a project doing image processing using C++. But I dont know how to load image (jpg or bmp) into MFC. And I need to make the image into graylevel image. also I need to get the graylevel of each pixel. Someone introduce me VFW, but I still cannot find out how to load image and get information of it... really need your help... Thanks...
coding, coding, still coding...
|
|
|
|
|
have a look at the cximage library here on cp ... it will do all that and more ... and u can study the source code to see how it does it too
"there is no spoon" biz stuff about me
|
|
|
|
|
Check out the CBitmap class and (H)BITMAP structure on MSDN.
You can use the CBitmap class to determin the RGB color of each pixel.
Hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
If you want to make advanced image processing application;
- First use DirectDraw to proceed display images.
- Learn .jpeg, .bmp file format
- Learn .bmp, .jpeg file compression decompression.
ICImageCompress(...) and ICIamgeDecompress(...) defined vfw.h will be helpful
|
|
|
|
|
Hi Again,
I have a low-level mouse hook that I'm using to capture input and then later reproduce it with SendInput.
Here's what I have:
INPUT input;<br />
::ZeroMemory(&input,sizeof(input));<br />
<br />
input.type=INPUT_MOUSE;<br />
input.mi.dx=nX;<br />
input.mi.dy=nY;<br />
input.mi.dwFlags=MOUSEEVENTF_WHEEL|MOUSEEVENTF_ABSOLUTE;<br />
<br />
MSLLHOOKSTRUCT* mHook=(MSLLHOOKSTRUCT*)lParam;
<br />
input.mi.mouseData=(int)(short)HIWORD(mHook->mouseData);
<br />
SendInput(1,&input,sizeof(INPUT));
The message will be sent, however, it has no effect. I've tried input.mi.mouseData=mHook->mouseData, but that will only scroll the mouse up, and msdn clearly indicates that the sign of the high-word indicates the direction. I've also tried multiplying by WHEEL_DELTA, with no effect.
How can I send the correct mouse movement event?
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Dear All,
I want to get the name of all tables of an ODBC datasource selected by user at runtime.
I am using Visual C++ 6.0 with MFC.
Any help regarding retrival of database schema of an ODBC database.
Thanks in advance
|
|
|
|
|
i think it depends on what database you are using. For Oracle is would be
select table_name from user_tables;
or for views
select view_name from user_views;
ODBC may provide a generic way to do this but I dont know
|
|
|
|