|
Hello,
Using MIB_IPADDRTABLE structure, you can retrieve IP addresses associated with every networks adapters. But what about retrieving a description of those network adapters (Bluetooth, Wi-fi, Ethernet...) Which function to use?
Thanks,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
Hi All,
I am having trouble resolving the following error.
error C2039: 'AddString' : is not a member of 'CString'.
Thanks in advance
C++Prog
|
|
|
|
|
I got it Thanks....
C++Prog
|
|
|
|
|
Hi,
I need to programmatically launch Winamp. But I don't get a clue how to do that.
Can somebody help?
Thanks,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
|
Thanks for replying.
But in order to use ShellExec or CreateProcess, I need to know where to find the Winamp executable installed on the user's computer. How can I find this path?
Thanks,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
The first thing to look for is does the exe support OLE automation - If it does you should use COM to launch it. I'm no WinAmp expert but after looking in the registry of my computer I knocked up the following program which launched WinAmp:
#include "stdafx.h"
#include <objbase.h>
static const CLSID CLSID_WinAmp =
{ 0x46986115, 0x84D6, 0x459c, { 0x8F, 0x95, 0x52, 0xDD, 0x65, 0x3E, 0x53, 0x2E } };
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CoInitialize(NULL);
IUnknown *pUnk;
if ( SUCCEEDED(CoCreateInstance(CLSID_WinAmp, NULL, CLSCTX_ALL, IID_IUnknown, reinterpret_cast<void**>(&pUnk))) )
{
pUnk->Release();
}
CoUninitialize();
return 0;
}
NOTES:
I hardcoded the CLSID which I got from the registry - There is probably an SDK that can be used. This would also contain interfaces which would enable to control the instance of WinAmp launched.
Steve
|
|
|
|
|
Thanks for your reply.
However, I've never done OLE programming before. Is the CLSID the same for every computer running Winamp?
Thanks
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
In general that's the idea - But I hacked this CLSID out of the registry; It wasn't sourced from any official documentation.
Steve
|
|
|
|
|
I have a CDialog based class and I put a CListCTrl on it then did the cTRL-W thing (VC6) to make a new class out of it. Now I realize I want more controls on it. IF I just draw them on, I dont get any thing mentioned in the class cpp file (I even rebuilt). So is it a fact that you have to have your design completely done before you make a class out of it?
|
|
|
|
|
ns wrote: So is it a fact that you have to have your design completely done before you make a class out of it?
No, not at all. You can open ClassWizard as many, or as few, times as you want.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
This is my second post about this subjet...
I whant to send a CDC to another computer via network...
and it is for creating a remote desktop application.
If there is a btter way (FASTER WAY) please help me. I don't want to send a whole picture to another computer bcuz it is slow and ridiculous.
Thanks
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
The C in DC stands for context, which infers that it is only meaningful in a specific context for a specific device. Sending that to another computer makes no sense. You can, however, send the screen data in chunks to the other computer. The Terminal Services API might be required, but I really don't know for sure.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I'm trying to track down an error where a message box comes up "Attempt to open busy clipboard window, OK to resume". Anyone see this before??
Thanks - harrier
|
|
|
|
|
What are you doing that causes this message to appear?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
This is partly the problem, no clear repro on it. When it happens it's frequent but not consistent. Most of the time it's the main app window becoming the active window.
harrier
|
|
|
|
|
So do you have code someplace that it interacting with the clipboard?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Probably. Not my code. Inherited. I try to find a repro before digging through code. I've googled all sorts of keywords and only found one non-english site with the same error message. Now here I am hoping someone who actually has written code for the clipboard knows what this means. I could try looking through code but I don't know what I'm looking for.
- Harrier
|
|
|
|
|
Here's the code I added to my CDialog
public:
virtual void OnInitialUpdate();
and
void CTargetInfo::OnInitialUpdate()
{
if(NULL != m_listTgtInfo.GetSafeHwnd())
{
(void)m_listTgtInfo.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_listTgtInfo.InsertColumn(0,"Keywords",LVCFMT_LEFT,800);
m_listTgtInfo.SetExtendedStyle(LVS_EX_CHECKBOXES);
m_listTgtInfo.InsertColumn(1,"Options",LVCFMT_LEFT,800);
}
}
It nevers enters the OnInitialUpdate
The way I am creating the dialog is
m_tgtInfo = new CTargetInfo(this);
if(!m_tgtInfo) return CDialog::OnCommand(wp, lp);
m_tgtInfo->Create(IDD_DLGTGTINFO, (CWnd*)this);
m_tgtInfo->ShowWindow(SW_SHOW);
Is there something else I need to do?
thanks,
sb
|
|
|
|
|
OnInitialUpdate() is for a view, not a dialog. Override OnInitDialog() instead.
ns wrote: The way I am creating the dialog is
m_tgtInfo = new CTargetInfo(this);
if(!m_tgtInfo) return CDialog::OnCommand(wp, lp);
m_tgtInfo->Create(IDD_DLGTGTINFO, (CWnd*)this);
m_tgtInfo->ShowWindow(SW_SHOW);
Why not create a modal dialog instead:
CTargetInfo dlg;
dlg.DoModal();
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks, David.
It needs to be modeless. Now that I made it OnINitDialog, it does go into the function but sidesteps my if safeHWnd block for the list control on that dialog:
if(NULL != m_listTgtInfo.GetSafeHwnd())
{
(void)m_listTgtInfo.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_listTgtInfo.InsertColumn(0,"Keywords",LVCFMT_LEFT,800);
m_listTgtInfo.SetExtendedStyle(LVS_EX_CHECKBOXES);
m_listTgtInfo.InsertColumn(1,"Options",LVCFMT_LEFT,800);
}
I thought my CListCtrl would have been made by the time the code gets to the OnINitDialog. So if I cant set the columns of the listbox in this function, where else can I set them?
thanks,
sb
|
|
|
|
|
ns wrote: I thought my CListCtrl would have been made by the time the code gets to the OnINitDialog.
The controls have been created, assuming you have bothered to call CDialog::OnInitDialog() first.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I hadn't bothered to call OnInitDialog first.
I did MFC a long time ago then have been with QT for ages, so I am remembering only bits and pieces. I'l try to look around a little more before I post. I've forgotten where the best places are to go look for information.
Thanks again David,
hopefully I ask better questions in the next few days
|
|
|
|
|
I would like to have access to all the pins on a serial port.
If i can get a handle to a COM port using CreateFile, does the interface allow me individual control over the 9 pins? So in other words the 9 signals some of which are DSR, RTS and DTR, can i toggle those through some class?
Thanks,
|
|
|
|
|
LCI wrote: I would like to have access to all the pins on a serial port
This is not possible given that you don't have a driver that supports it.
The standard windows driver for serial devices does not support it.
What do you really mean by "access to all pins"? Do you really need access to all of them, or is it just a few?
Some of the pins are possible to control such as DTR and RTS by the use of ::SetCommState() and the DCB struct.
Do you intend to send serial data at all or do you wish to use the serial port in a way that it's not primarily designed for?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|