|
Yup. You can use Winsock API for this. However, I would consider easier solutions (SOAP?).
I vote pro drink
|
|
|
|
|
Thanks for your help. What other solutions do you suggest other than SOAP?
|
|
|
|
|
Well, depends on your concrete situation. If your clients use firewalls (I guess they do), than you'd better stick with HTTP (with SOAP or without it - maybe plain HTTP POST). If they don't use firewalls, than you can use something like DCOM or CORBA.
I vote pro drink
|
|
|
|
|
Hello, the codegurus around the world.;)
If you can use HTTP, FTP or Gopher, WinInet API function is another option.
If you want to use your own Server throuth TCP/IP, WinSock (or CSocke...) is only choice.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I'm trying to capture a screen from the windows media player. It appears that they use a directx overlay for the video (not completely sure). So, if you try to capture it through the normal GDI means, all you get is the black background.
There is at least one program available that can capture it through directx, but I am trying to figure out how it is done. Can anyone tell me how to get access to the directx surface to obtain the data? EnumSurfaces appears to work only inside the same process and inside the same directdraw object. Please help!
|
|
|
|
|
My application(.EXE) drops a buch of events into the event log for the network admin folks and other users.
In my MFC prject, I have an event message file <filename>.MC which is compiled separatedly using "mc" command line utility. After message compilation, <filename>.rc, <filename>.h and MSG00001.bin files are created by "mc". The problem is that I only know how to produce event message resource table for the evnt viewer using command line "rc"(produces <filaname>.res) and "link" step, which finally produces <filename>.dll(it will contain the table). To automate this process, I had to write a batch file, which executes all these utilites. This batch file is automatically executed in the post-build step - pretty cumbersome and boring, isn't it? This is the old Win32 way of doing things for the event viewer, and I don't particularly like it. I know that the message resource table can be easily contained within the same executable that runs my project, which will save the headache of managing two separate files, .EXE - the program, and .DLL - program's event message table.
Tried many things with .rc files and recourse.h - event viewer only recognizes messages from the .dll.
Does anyone know how to properly merge .rc and .res files within the same project to create one common resource table that will contain the prject's resources as well as its event message table.
Will be happy to digest any hints.
Thanks.
Kirill
|
|
|
|
|
Just put this line in the top of the project's .rc file...
1 11 msg00001.bin
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Help. I want to change the appearence of a check box control so that it looks flat, no background, no border, only the check appears.
The control will serve as a visual indicator and not accept input from user.
How can I do this or where should I look?
Thanks,
John
|
|
|
|
|
No background? You mean that there will be some other controls below and you want to see them?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want the Check Box to have the same "grey" background as the Dialog which contains it -- i.e. no white background, no border around the check box.
I hope this won't be impossible or have to resort to display a bitmap.
Thanks.
Johnny
|
|
|
|
|
Derive your class from CWnd and call DrawFrameControl in OnPaint handler. DrawFrameControl can draw many UI elements, some combination of flags should give you just checkmark on standard background. No bitmap required.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
Just use a picture control with an icon - that way the background will be see-through. Then use ShowWindow(SW_SHOW / SW_HIDE) to show or hide the control.
--
Andrew.
|
|
|
|
|
Thanks.
I guess I was intimidated by using a graphic.
John
|
|
|
|
|
I have a DB in Access 2000 for which I'm trying to access from a VC++ executable using DAO. When I try to query the DB I get a dialog asking me to select a data source. If I convert the database back to a prior version which I believe is 97 format, it works fine. Might anyone know why I get the data source dialog and how I might be able to get these queries to work with a 2000 version of the DB?
Also, is it possible to convert a 2000 DB to 95? I see that Access says it can convert back to a prior but I'm wondering if this prior version is 97 and not 95.
Thanks!
"Save a tree, use Email!"
|
|
|
|
|
Check KB article Q236991.
Basically, if you're linked to MFC DLL, this should be enough to enable DAO 3.6:
AfxGetModuleState()->m_dwVersion = 0x0601;
AfxDaoInit();
There's C++ Q&A column in Jan'2000 issue of MSJ that also describes this.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi all,
Is there a way to detect if the program I'm about to launch already running?
In other words, I don't want to have more than one of the same application running. So far, I've tried EnumProcesses() and other
good stuffs but have no luck. I have a function called ProcessExist(),shown below, to detect if the specified app is currently running.
This function works if I call it from another application.
The problem is that if I call ProcessExist() inside my application, that application is ALREADY running, so ProcessExist() doesn't solve the problem.
Any help is appreciated.
Thanks
//////////////////////////////////////////////////////////
CString CMyProcess::GetProcessName(DWORD pid)
{
char ProcName[MAX_PATH]=_T("unknown");
CString Name;
HANDLE handle=OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,pid);
if (handle)
{
HMODULE hMod;
DWORD needed;
if (EnumProcessModules(handle,&hMod,sizeof(hMod),&needed))
{
GetModuleBaseName(handle,hMod,ProcName,sizeof(ProcName));
Name = ProcName;
}
CloseHandle(handle);
}
return Name;
}
BOOL CMyProcess::ProcessExist(LPCTSTR lpProcName, CString &fullpathname, DWORD &pid)
{
DWORD pids[1024];
DWORD bytes_needed=0;
DWORD num_procs=0;
BOOL result = FALSE;
CString str;
if (EnumProcesses(pids,sizeof(pids),&bytes_needed))
{
num_procs = bytes_needed / sizeof(DWORD);
for (DWORD i=0; i
|
|
|
|
|
A small thing which you can do is as follows.At the beginning of the
program call a small function say init() which creates a mutex ,if that
mutex already exists that means you have another instance running.
BOOL init()
{
HANDLE mutex = CreateMutex(NULL, FALSE, "mutexname");
if(mutex == NULL)
return FALSE;
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
MessageBox("Another instance is already running.");
return FALSE;
}
return TRUE;
}
|
|
|
|
|
Thanks Rachna. I'll try that.
|
|
|
|
|
Hello
You can use this class [from MSDN]
#ifndef LimitSingleInstance_H
#define LimitSingleInstance_H
#include <windows.h>
class CLimitSingleInstance
{
protected:
DWORD m_dwLastError;
HANDLE m_hMutex;
public:
CLimitSingleInstance(TCHAR *strMutexName)
{
m_hMutex = CreateMutex(NULL, FALSE, strMutexName);
m_dwLastError = GetLastError();
}
~CLimitSingleInstance()
{
if (m_hMutex)
{
CloseHandle(m_hMutex);
m_hMutex = NULL;
}
}
BOOL IsAnotherInstanceRunning()
{
return (ERROR_ALREADY_EXISTS == m_dwLastError);
}
};
#endif
hope this helps
Nish
|
|
|
|
|
How to create a string with the identifier "IDS_STR1"?
I use the following statement to declare IDS_STR1.
#define IDS_STR1 1;
Thanks.
Maer
|
|
|
|
|
Are you talking about the string table in resources?
You can use a string table resource with CString via the LoadString method.
CString sTemp = _T("");
sTemp.LoadString(IDS_STR1)
Michael
|
|
|
|
|
|
CString strWhatever(MAKEINTRESOURCE(IDS_STR1));
or
CString strWhatever;
strWhatever.LoadString(IDS_STR1);
|
|
|
|
|
Hello, the codegurus around the world.;)
We can create the string with IDS_STR1 in the string table of the resource section
in Visual studio.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|