|
Hello all,
Currently, we are planning to do a project on WLAN Monitoring System in VC++.NET. We tried WRAPI. It is not showing any compilation error. But, finally, when it starts execution, it shows ntdll.dll initialization error. Why is it showing error? Also, immediately it is showing a Access Violation Error in user32.dll.
Please guide me.
|
|
|
|
|
i want to develop a plugin for internet explorer which should be activated when the print option on browser window is clicked...does anyone know how to capture the events from the browser.the plugin is being developed in VC++ (MFC)
|
|
|
|
|
In MDI, i created a child window..by adding some commands in InitInstance function in ProjectApp.cpp.
I got the perfect child window..but there is no facility to close the window..Is there any way...
Pls help me..
Im using SetWindowPos() to set window position in Mainfrm.cpp..
Pls help me
|
|
|
|
|
|
Hello!
I'm working with an MFC dialog based app and am using:
SendMessage(GetDlgItem(hDlg, IDC_EDIT_CHATLOG),
EM_EXSETSEL, 0, (LPARAM)&ch);
But I don't have a way to get the hDlg parameter which is the handle to the window.
Anyone know how to get the handle to an mfc dialog box win?
thanks in advance,
jay
|
|
|
|
|
That depends on where that code is. Is it in a member function of the dialog? If so, just use the CWnd wrapper:
SendDlgItemMessage(IDC_EDIT_CHATLOG, EM_EXSETSEL, 0, (LPARAM)&ch); Otherwise, use AfxGetMainWnd() to get a pointer to the main window:
AfxGetMainWnd()->SendDlgItemMessage(...);
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi,
you can use one of the following 3 methods to retreive the handle of a control
1. insinde the dialog you can get a window object of the control:
CWnd* pWnd = GetDlgItem(IDC_EDIT1);
HWND hWnd = pWnd->GetSafeHwnd();
2. insinde the dialog you can get the handle of the control:
HWND hWnd2 = NULL;
GetDlgItem(IDC_EDIT1, &hWnd2);
3. from anywhere you can get a handle of a control by using:
HWND hWnd3 = ::GetDlgItem(pDlg->GetSafeHwnd(), IDC_EDIT1);
if you need to get a unknown window you'v got to find it using the following code:
HWND hwndThis = ::FindWindow(NULL, _T("DlgTest")); where _T("DlgTest") is the caption of the window you are looking for
codito ergo sum
|
|
|
|
|
Awesome except I need the handle to the MFC dialog window!
|
|
|
|
|
What do you mean with the MFC dialog window!
codito ergo sum
|
|
|
|
|
The HWND handle to the MFC dialog box, I think AfxGetMainWnd() will work but for some reason I've been having a bit of trouble trying to implement it in a small UDP voice chat server app.
|
|
|
|
|
Hi,
can you be a little specific of the location in code from where did you try to
get the handle of the dialog?
Is it from a thread handling the UDP connection and is the dialog you reffer to the main
dialog of a dialog base application. In that case you should give the handle to the window/dialog
via a paramter to the thread when constructing the thread.
Or could you tell me a little more of the design of your application so that i can spot
your problem
codito ergo sum
|
|
|
|
|
Yea I'm sorry guys I should have been more descriptive.
I've figured it out now, but basically all I was trying to do was log messages to an edit box control inside an mfc dialog based app in a CString. Now initially I was trying to do this from inside the server's functions, which I then realized all I needed was to either it global or pass it to each server's functions. Then I couldnt figure out why the strings weren't being added to the log window correctly, then I saw I needed to go inside the Dialog's Timer function where I handle my updating for my server and refresh the window every 60th of a second.
All in all it was more of the fact I forgot where I needed to call what, exactly as you said. I'll remember to be more specific next time, but the help was much much appreciate and used!
Jay Aigner
http://wwww.jdaigner.com
|
|
|
|
|
Im using MS VS 2005. I made a solution, built a solution in realease, and tested on my computer. My program worked well. But when I copied the realease to another computer, it didnt run ( an error and advice "reinstall your application "!!!). I checked all the dll (in my solution, just 1), and test in many computers, but it still broken. But It still run well on my computer. What's the problem ???
-- modified at 23:45 Friday 10th February, 2006
|
|
|
|
|
|
I found function online that some how manipulates the byte order of a program and writing a jmp, where its not ariginally at http://www.devx.com/Intel/Article/21023/2046[^]
but what id like to know is how to get a function like this to skip a process calls like, TerminateProcess() or ExitProcess().
*or simply how would i get a remote application from closing or maybe just filterring the wm_close to reach that window in c++?
|
|
|
|
|
I was thinking their was some WriteVirtualMemory() that will will do this? But i don't know?
|
|
|
|
|
can anyone help me to find a good, recent directx tutorial? i am using visual studio express edition, if that makes a difference. i have looked for a little while without luck. any help provided would be greatly appreciated.
- Kyle
|
|
|
|
|
I am now starting to learn VC++. Can some want share me a good e-book to start!
Thank you!
FILWY
|
|
|
|
|
Programming Windows, 5th Ed by Charels Petzold,
Programming Windows with MFC, 2nd Ed by Jeff Prosise...
That should Do
kss
|
|
|
|
|
I am staring to learn how to interact with MD2 in c++. Can some one give me a basic tutorial!
FILWY
|
|
|
|
|
I am trying to output to the console and trying to center words on the screen. I realize that I cold assume 80 characters can be displayed across - its pretty much the absolute standard these days - but I was wondering if anyone knows a function to get the character width of the console output so that I can use that to be a little more universal in my centering function. Anyone know?
sincerely, Brett Peirce - PolerBear
To err is human; To forgive: divine.
|
|
|
|
|
I found the code that you want in here.
http://www.koders.com/c/fidD1457B7594BFF764B76CFFDBCD7E2EDE2E4188C3.aspx?s=telnet
And I tested it like below, and I could get the result;
// consoletest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <conio.h>
void SetConsoleSize(HANDLE hConsole, SHORT xSize, SHORT ySize)
{
CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */
BOOL bSuccess;
SMALL_RECT srWindowRect; /* hold the new console size */
COORD coordScreen;
bSuccess = GetConsoleScreenBufferInfo(hConsole, &csbi);
/* get the largest size we can size the console window to */
coordScreen = GetLargestConsoleWindowSize(hConsole);
/* define the new console window size and scroll position */
srWindowRect.Right = (SHORT) (min(xSize, coordScreen.X) - 1);
srWindowRect.Bottom = (SHORT) (min(ySize, coordScreen.Y) - 1);
srWindowRect.Left = srWindowRect.Top = (SHORT) 0;
/* define the new console buffer size */
coordScreen.X = xSize;
coordScreen.Y = ySize;
/* if the current buffer is larger than what we want, resize the */
/* console window first, then the buffer */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y > (DWORD) xSize * ySize)
{
bSuccess = SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect);
bSuccess = SetConsoleScreenBufferSize(hConsole, coordScreen);
}
/* if the current buffer is smaller than what we want, resize the */
/* buffer first, then the console window */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y < (DWORD) xSize * ySize)
{
bSuccess = SetConsoleScreenBufferSize(hConsole, coordScreen);
bSuccess = SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect);
}
/* if the current buffer *is* the size we want, don't do anything! */
return;
}
int main(int argc, char* argv[])
{
HANDLE hStdout;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleSize(hStdout, 100, 100);
printf("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n");
getch();
return 0;
}
Enjoy
Anderson Sheen
http://www.exteide.com
-- modified at 22:04 Friday 10th February, 20060ff>http://www.exteide.com</a></font></div>
|
|
|
|
|
help me!
when i try to use LowLevelKeyboardHook() to get the keyboardstroke it work well but i can't modify them! i don't understand?
another question!
when i write a code that using LowLevelKeyboardHook() i have to use KBDLLHOOKSTRUCT, i have included <winuser.h> already; but i alway get an error. something like that:
KBDLLHOOKSTRUCT is the missing struct or class.i don't understand again.(i'm using windows XP,and VSC++6.0).
Please help me!
|
|
|
|
|
Did you download latest SDK in here[^]?
But I didn't try to test the func so it's not exactly for the problem.
Enjoy
-- modified at 22:17 Friday 10th February, 2006
|
|
|
|
|
Thanks for reply.
i got two answar first use satan keyword so where to use it?
second one getparentframe().i dont know getparentframe function of which class is it of Document or view plz specify me
sourabh jain
patni computers system
|
|
|
|