|
Dear all
I need to know which DMA line is assigned to the parallel port of system in Visual C++ environment.
May you Please Help me.
Regards
Mahdi
|
|
|
|
|
I have added a menu item to the shellcontext menu using shell extensions(ATLCOM AppWizard).When i select the item some operation will be performed.Now i want to attach this feature to an SDI application i.e,when the SDI application is runned this menu item should be inserted to the shell context menu automatically .Any article based on the above problem will be of more help.So,how can i add these two applications into a single application.
Thanks.
|
|
|
|
|
hi,
i created a control then i want to navigate the url but i am getting this error
RECT rectClient;
GetClientRect(&rectClient);
// create the control window
// AFX_IDW_PANE_FIRST is a safe but arbitrary ID
if (!m_wndBrowser.CreateControl(CLSID_WebBrowser, L"Browser",
WS_VISIBLE | WS_CHILD,
rectClient, this,
AFX_IDW_PANE_FIRST))
{
DestroyWindow();
return FALSE;
}
// Get interface pointer
LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
HRESULT hr = lpUnk->QueryInterface(IID_IWebBrowser2,
(void**) &m_pBrowserApp);
if (!SUCCEEDED(hr))
{
m_pBrowserApp = NULL;
m_wndBrowser.DestroyWindow();
DestroyWindow();
return FALSE;
}
Nav2URL(L"http://www.yahoo.com/");
}
application exist by giving following messages
Load module: browsres.96.dll
Persistence not supported on OLE control {F5AFC7EF-1571-48B6-A69C-F1833F4C3A44}.
>>> Result code: 0x00000000
Load module: webview.dll
Load module: shlwapi.dll
Load module: wininet.dll
Load module: urlmon.dll
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
RaiseException: Thread=9663ba08 Proc=814c6f20 'TestPcBrowser.exe'
AKY=00004001 PC=03fa27d8(coredll.dll+0x000427d8) RA=800773f4(NK.EXE+0x000073f4) BVA=00000000 FSR=00000000
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
RaiseException: Thread=9663ba08 Proc=814c6f20 'TestPcBrowser.exe'
AKY=00004001 PC=03fa27d8(coredll.dll+0x000427d8) RA=800773f4(NK.EXE+0x000073f4) BVA=00000000 FSR=00000000
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
RaiseException: Thread=9663ba08 Proc=814c6f20 'TestPcBrowser.exe'
AKY=00004001 PC=03fa27d8(coredll.dll+0x000427d8) RA=800773f4(NK.EXE+0x000073f4) BVA=00000000 FSR=00000000
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
RaiseException: Thread=9663ba08 Proc=814c6f20 'TestPcBrowser.exe'
AKY=00004001 PC=03fa27d8(coredll.dll+0x000427d8) RA=800773f4(NK.EXE+0x000073f4) BVA=00000000 FSR=00000000
The thread 0x3675a88a has exited with code 0 (0x0).
venu
|
|
|
|
|
what is .net framework
qwd
|
|
|
|
|
|
Just woke up from hibernation ? , welcome back.
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Hi.
I need to pass parameters to sub fuction. it is surely easy. but,
when it comes to variable parameter.. how can I do that?
for example,
void MyPrintf(char * msg, ...)
{
printf(msg ,????); // <- here
// something extra
}
thanks in advance.
|
|
|
|
|
void MyPrintf(char * msg, ...)
{
va_list va;
va_start(msg, va);
vprintf(msg, va);
}
|
|
|
|
|
i have a titlebar less dialog application. i wouldlike to add system menu to my icon. any ideas?
|
|
|
|
|
I remember seeing something to that effect in the vc.mfc google group. Give it a search.
|
|
|
|
|
Dear all
I use AfxBeginThread in one dll program. this thread is responsible for logging data.
When I debug program, I trace until I reach the AfxBeginThread Line .
program dont continue and a suspend state begins.
When I debug the program into AfxBeginThread line, I find that When it reachs the
VERIFY(::WaitForSingleObject(startup.hEvent, INFINITE) == WAIT_OBJECT_0);
::CloseHandle(startup.hEvent);
in threadcore.cpp function, the ack of waitforsingleobject never comes and program suspends.
Do you have any idea about this problem.
Best regards
Mahdi
|
|
|
|
|
how are you creating the thread ?
|
|
|
|
|
I find the reason.
When I call the AfxBeginThread in MFC driven class constructores I see this problem.
but when I call it in another function, I dont see this problem.
|
|
|
|
|
I find the reason of this error.
When I call AfxbeginThread in MFC class constructures, I see this problem.
|
|
|
|
|
Hi all
i have developed a web server. Whenever a client connect to my web server, i create a thread and process the rquest. In my thread, each time i create one COM component(Script engine vbscript.dll)using CoCreateInstance. so i am facing a problem while calling the CoCreateInstance().
Is any good method to avoid frequent calls to the COM component. I mean
one time initializing my engine and using it whenever i need
thanks
g.shadrach
|
|
|
|
|
why not use this way
CoGetClassObject(rclsid, dwClsContext, NULL, IID_IClassFactory, &pCF);
hresult = pCF->CreateInstance(pUnkOuter, riid, ppvObj)
pCF->Release();
just to call
CoGetClassObject(rclsid, dwClsContext, NULL, IID_IClassFactory, &pCF);
first time it will ensure the dll loading.
then whenever you want to create an instance just call
hresult = pCF->CreateInstance(pUnkOuter, riid, ppvObj)
|
|
|
|
|
OK. i will change my code and let me see
|
|
|
|
|
Hi, i've created a droplist combo box, and listed a few item. Are there anyone who know how to link the clicked item to a certain file saved in text format. I'll then need to send the file to hardware after clicking on the ok button in the dialog box. This is some code that i found in this site. It just shows to get the selection from the droplist. In my dialog box i've created a function to open,browse and load the file. Now i need to figure out how to write the code to automatically link the clicked item in the droplist to a certain text file and also display it in the other function(open,browse and load the file). Also, each item listed in the droplist correspond to different text file. Is there any suggestion on what codes i should add? Is there any article or example that i can refer to? i'm a begineer here.
void CComboBoxTutorialDlg::OnDropListSelchange()
{
UpdateData();
if( m_nDropListIndex < 0 ) return;
CString str;
m_DropList.GetLBText( m_nDropListIndex, str );
CString Out;
Out.Format( "Drop List Selection => index %d\n%s", m_nDropListIndex, str );
AfxMessageBox( Out );
}
thanks in advance
|
|
|
|
|
it is better to divide your problem in parts.
1:get selection from combo box
for this you should handle the notification ON_CBN_SELCHANGE
in this handler get the selection with GetLBText()
2: how to relate data
For this purpose you can use GetItemData() and SetItemData()
or GetItemDataPtr() and SetItemDataPtr()
|
|
|
|
|
cyn8 wrote: UpdateData();
if( m_nDropListIndex < 0 ) return;
What is this supposed to do?
Try:
int nIndex = m_DropList.GetCurSel();
m_DropList.GetLBText(nIndex, str);
...
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In MFC we can choose SDI, MDI or Dialog based application to create but in Win API I don't know how to create SDI application like NodePad. Please answers to me soon.
Thanks.
|
|
|
|
|
In Win32 API we usualy use the CreateWindow() function and WinProc() function to process messages
here is an example of Single Document Interface (I took this piece of code from my recent project )
/*************************
The framework for any
Single-Document-Interface
application
**************************/
//////////////////////////////
// #include
//////////////////////////////
/* windows.h contains *all* of
the things we need for this demo */
#include "windows.h"
//////////////////////////////
// #define
//////////////////////////////
//////////////////////////////
// prototypes
//////////////////////////////
/* this is the prototype for our Window
Procedure: it is called by Windows (the O/S)
(hence the CALLBACK) and it returns a
LRESULT (long). It's parameters are a
HWND (handle to a window), a UINT (unsigned integer,
which represents the message), a WPARAM
(a special unsigned integer that contains extra
information about the message being sent) and finally
a LPARAM (a special long which also contains information
about the messge being sent) */
LRESULT CALLBACK WinProc(HWND, UINT, WPARAM, LPARAM);
//////////////////////////////
// globals
//////////////////////////////
/* in this example, szAppName is the windows title.
The TCHAR is an unsigned short and is necessary for
portability between Windows 9x and Windows NT. The same
is true for the TEXT() macro, which could be replaced
by a lot of things, eg: _T() or __T() or T() */
TCHAR szAppName[] = TEXT("SDI Frame");
/* the szWinClass is necessary later when we register
the window class */
TCHAR szWinClass[] = TEXT("WIN_CLASS");
//////////////////////////////
// WinMain(...)
//////////////////////////////
/* the WinMain(...) function is the entry point
for all Win32 API programs (except MFC). It is the
Windows equivalent of main(...).
It returns an integer value and the WINAPI could
have been PASCAL or any other equivalent calling-convention.
It's parameters are two instances (the first one is the
current instance and the second one is the now obsolete
previous instance, which is no longer used), a command-line
(how to deal with this is in the next tutorial) and an
integer dictating how to show the window (either Maximised or
Minimised) */
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR lpCmdLine,
int nCmdShow)
{
MSG msg; // a struct used in the passing of messages
WNDCLASS wc; // a window class struct, see below
HWND hwnd; // a handle-to-a-window, see below
/* the window class struct is the first step in setting up
a window. all of the attributes are set before the class is
registered. Each window class can be used to create more than
one window. Also, there are predefined controls that have their
own class and, as you will see, their own Window Procedure. These
controls include: Edit Boxes, Combo Boxes, Scroll Bars, etc. */
wc.cbClsExtra = 0; // specify how many bytes extra space is required for every window derived from this window class
wc.cbWndExtra = 0; // specify how many bytes extra space is required for this window
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); // background colour
wc.hCursor = LoadCursor(NULL, IDC_ARROW); // cursor, this is usually the default
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); // icon, this can be changed using resources (shown in the next tutorial)
wc.hInstance = hInstance; // the current instance of the program is passed to the instance of the class
wc.lpfnWndProc = WinProc; // the window procedure used by this class, usually has a more distinguishing name
wc.lpszClassName = szWinClass; // the name of this class
wc.lpszMenuName = NULL; // the name of the menu to be attached to the window, null until next tutorial
wc.style = CS_HREDRAW | CS_VREDRAW; // these 'class styles' mean that the window will be redrawn whenever it is resized vertically or horizontally
if( !RegisterClass(&wc)) // register the class, and test if it fails
{
MessageBox(NULL, TEXT("Error registering class"), TEXT("ERROR"), MB_OK);
return 0;
}
hwnd = CreateWindow(szWinClass, // the class as specified in the one we just registered
szAppName, // the title of the window
WS_OVERLAPPEDWINDOW, // the window style (there are usually a lot more of these
CW_USEDEFAULT, // the left co-ord of the window
CW_USEDEFAULT, // the top co-ord of the window
CW_USEDEFAULT, // the width of the window
CW_USEDEFAULT, // the height of the window
(HWND) NULL, // a handle to the parent window
(HMENU) NULL, // a handle to the window's menu
(HINSTANCE) hInstance, // the instance of the window (which is the instance of the app)
(void *) NULL); // any extra information (I think it is passed to the window when it is created in the lParam of the WM_CREATE message?)
// WM_CREATE message has been sent to the window
ShowWindow(hwnd, nCmdShow); // shows the window, using the specified command (Maximised, Minimised, etc)
UpdateWindow(hwnd); // the window is updated (a WM_PAINT message is sent to the window
while (GetMessage(&msg, (HWND) NULL, 0, 0)) // while there is a message to retrieve, and that message is not WM_QUIT
{
TranslateMessage(&msg); // some messages need translating
DispatchMessage(&msg); // send the message to the window
}
return msg.wParam; // return the message struct's wParam
}
//////////////////////////////
// WinProc(...)
//////////////////////////////
/* every window must have a function that Windows (the O/S) calls.
It uses a switch statement to test which message it is receiving */
LRESULT CALLBACK WinProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
switch(msg)
{
case WM_PAINT:
/* the following two lines are the minimum
that has to be done for every program */
hdc = BeginPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
/* between those two lines you could have
outputted text etc. */
return 0;
case WM_DESTROY:
/* if the quit message is not posted then the while
that we created in WinMain(...) will not quit and the
application will disappear from view but will still be
resident in memory */
PostQuitMessage(0);
break; // pass to DefWindowProc(...) as well
}
/* takes care of all of the messages that we didn't catch
in our Window Procedure */
return DefWindowProc(hwnd, msg, wParam, lParam);
}
---
-- modified at 18:19 Saturday 4th November, 2006
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
Hi,
I'm looking for a way to change the internet settings programaticly so i used many WIN32 APIs such as WININET and RAS ,I found that the second method work easily by filling the RASDIALPARAMS
structure but with only phone line connection (means that we can not use adsl modem) whereas
the first method appears difficult or its not clear for me .
Could someone give me an exemple to change all settings connection (time out, Number of retries..ext) with WININET APIs or another method if exist
Thanks
---
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
hi i need help since im new to device interfacing
i wanted to create my own application using a particular device and i dont knw where to
start(where to i begin create a com?enumerate the device?need help)
this device in particular is a color calibrator device.
|
|
|
|
|
|