|
Chandru080 wrote: wDirect Show() API's
Can you be little bit more elaborate on this?
|
|
|
|
|
|
voice chat in a socket client/server program.
assume the server has 3,000 clients connected, one client chats to others in voice (maybe a song).
I think it is not a good idea to submit the song to server from the client then server broadcasts to all other 3,000 clients through sockets, because a song may last for long time interval and consumes too many server's resources.
what do you do in the case?
.
|
|
|
|
|
I check out what Peer-to-peer[^] networking is?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hi
Any sample or help?
www.logicsims.ir
|
|
|
|
|
|
I have a .dll that I want to port to 64bit. To differentiate it from the 32 bit version I named it <name>64.dll only to find that the <module>64.dll that uses it couldn't load it as it
was still looking for <name>32.dll. That is when I discovered that the <name>32.dll is exported in the .def file. Changing the .def file to export <name>64.dll DOES work.
However,
The <name>32.dll and <name>64.dll are differentiated by configuration only, not project. A project can have only one .def file. Thus we have to remember to manually change the .def when changing compilations from 32 to 64 bit and vice versa.
The thought of using __declspec() instead of a .def file came up but I was told by the original programmer that he had to drop them for some problem and had to go to the .def file.
We thought about making two projects in the one <name>.sln file. But it seemed to be too much of a hassle for such a small problem.
So how can I make it so changing the configuration of a C++ project changes what is exported as the LIBRARY in a .def file?
|
|
|
|
|
Just a guess, but #ifdef in the .def file looking for the different target might let you export something different.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Thanks for your answer chris,
Yes I had tried #ifdef in the .def file, however a .def is not c/c++ code. A .def file doesn't know what a #ifdef is. Its some other kind of language.
For instance in c/c++ code /* or // is comment. In a .def file ; is a comment.
|
|
|
|
|
have you tried adding one .DEF for each configuration then excluding each from the build that doesn't use it (right-click, properties, choose the appropriate config, exclude from build) ?
i've never tried that with .def files, but it works for source files.
|
|
|
|
|
Thanks for your response,
Yes I tried this. Basically Microsoft Visual Studio stops you from adding more than one .def file to any project.
So regardless if its a single configuration project or if it is a multi configuration project you can only have one .def file.
I am trying to add the .def file using the IDE's add to project methodology so you may know around this that I don't.
|
|
|
|
|
is there any reason you need to specify the DLL's name in the .DEF file ? it's not required for the linker.
the .DEFs we use typically only have a DESCRIPTION tag and then the EXPORTS list
|
|
|
|
|
Oh wow hey cool! Your right, the LIBRARY line will force a dependancy on a paticular name. But if you don't have the LIBRARY line in the .def file then the dependancy on the name is the name of the .dll itself.
Thanks! Much happiness
|
|
|
|
|
Hi all,
I am trying to create DSN SQL Server at run time,but i am not able to do it.
bool aDSNCreated = false;
RETCODE retcode= SQL_SUCCESS;
aDSNCreated = SQLConfigDataSource(NULL, ODBC_ADD_DSN, "SQL Server (*.MDF) \0", _T("DSN=Login\DBQ=E:\\Login_Data.MDF\0")); /
if(aDSNCreated == false)
{
retcode = SQLInstallerError(2, NULL,NULL,100,NULL);
}
Am i doing anything wrong,please help me
Thanks
Manju
|
|
|
|
|
Have you tried:
SQLConfigDataSource(NULL, ODBC_ADD_DSN, "SQL Server (*.MDF)", _T("DSN=Login\0DBQ=E:\\Login_Data.MDF\0"));
What does SQLInstallerError() have to say?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I have a Dialogue and a Button "Open".I want when i click on "Open" Button,an other application will open.I know MFC guide to use CreatProcess Function but i don't know how to add this function into "Open" Clicked event. Please help me.
Example i have:
void CThunghiemDlg::OnButtonOpen()
{
}
|
|
|
|
|
I think the above comment makes it fairly clear what you need to do. Just add the code to run the external application. Or have I misunderstood your question?
The best things in life are not things.
|
|
|
|
|
My question is how to call a application (example FireFox.exe) when i click in "Open" Button on Dialogue.I don't know use CreateProcess in function : "void CthunghiemDlg::OnOpen" because CreateProcess is function return Bool Value,and with what value of this function is a application called?
|
|
|
|
|
camuoi288 wrote: .I don't know use CreateProcess
All explained here[^].
camuoi288 wrote: because CreateProcess is function return Bool Value
This is merely a value to tell you whether CreateProcess() succeeded or not.
The best things in life are not things.
|
|
|
|
|
|
What exactly don't you know? As you said it you'd have to add the code for creating a process in the button click event handler.
|
|
|
|
|
Example i want to call InternetExplorer.exe when i click on "Open" button,so what code i need add to "void CthunghiemDlg :: OnOpen".
Because CreateProcess is function return Bool Value.
|
|
|
|
|
Simple Example of CreateProcess
DWORD g_nRetVal = 0;
DWORD g_nWaitCode = 0;
HANDLE g_hWaited = NULL;
DWORD WINAPI RunUtils(void *pParam) {
LPCTSTR szExe = TEXT("Path of executable");
LPTSTR szParams = TEXT(" /d C:");
HANDLE hEvent = NULL;
PROCESS_INFORMATION ProcessInfo;
ZeroMemory(&ProcessInfo, sizeof(ProcessInfo));
STARTUPINFO StartupInfo;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (CreateProcess(szExe, szParams, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &StartupInfo, &ProcessInfo)) {
g_nWaitCode = WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
switch (g_nWaitCode) {
case WAIT_OBJECT_0:
GetExitCodeProcess(ProcessInfo.hProcess, &g_nRetVal);
break;
case WAIT_FAILED:
g_nWaitCode = GetLastError();
break;
}
::CloseHandle(ProcessInfo.hProcess);
::CloseHandle(ProcessInfo.hThread);
ResetEvent(hEvent);
HWND hWnd = (HWND) pParam;
SendMessage(hWnd, WM_USER_THREAD_WAITED, 0, 0);
}
return 0;
}
void CThunghiemDlg::OnButtonOpen()
{
HANDLE hExecThread = NULL;
if(m_bCleanUp)
{
hExecThread = CreateThread(NULL, 0, &RunUtils, (LPVOID) m_hWnd, 0, NULL);
}
}
You can do the same by using ShellExecute
void CThunghiemDlg::OnButtonOpen()
{
ShellExecute(NULL, "open", "path of executable", NULL, NULL, SW_SHOWNORMAL);
}
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
I want to ask:
"m_bCleaup variable and WN_USER_THREAD_WAITED variable".How are they declared?and how to use them?
|
|
|
|
|
no need to use these variable.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|