|
when i want to import library - do i have to write all the path?
the reason i asked this question is because i use the
WSALookupserviceBegin() function,so i included the "winsock2.h"
and in Project->Settings->Link tab i added this path:
C:\Program Files\Microsoft Visual Studio\VC98\Lib\Ws2_32.Lib
but i get this message:
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
also,i forgot to say that i'm developing in embedded visual c++,
but it's not working on visual c++ too.
thanks again,eli.
|
|
|
|
|
No, you only need to write the lib file name. Alternativley you can also try following line after #include.
#pragma comment(lib, "Ws2_32.lib.lib")
I have only tried this on VC++, not embedded one.
Arsalan Malik
|
|
|
|
|
Thanks,i will try this...
|
|
|
|
|
I’m successfully manage to run the zipprogram gzip.exe programaticly like this:
<br />
ShellExecute( NULL, "open", "C:\\gzip.exe", strParam, "C:\\Program Files\\Ceco", NULL ) ) )<br />
How do I after this call wait until gzip.exe has returned. (The file that gzip.exe creates do I want to rename.)
_____________________________
...and justice for all
APe
|
|
|
|
|
I would recommend a read of
http://www.codeproject.com/system/newbiespawn.asp
But it would be something like
(Code Taken from the article above)
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
Regards
Darren
|
|
|
|
|
Another good article is
http://www.codeproject.com/threads/asyncprocnotify.asp
Hope it helps
Darren
|
|
|
|
|
I want to know if I push down the POWER key and my program want to know this message what should I do?
|
|
|
|
|
Depending on what that key is configured to do, you may not get notified at all. On my computers, the power key is always reconfigured to be 'off' rather than the default setting of 'standby' or 'hibnernate'. Therefore, when I press that button, the computer goes off, period.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
__try
{
int i=0;
}
__finally
{
}
OK;
__try
{
CFile file;
}
__finally
{
}
Error:Cannot use __try in functions that require object unwinding
|
|
|
|
|
There are nasty interactions between SEH and C++ destructors. Martin Ziacek's article SEH and C++ Exceptions - catch all in one[^] explains how to catch SEH with regular try and catch , which is IMHO the way to go.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
hi,
i'm trying to set up BlueTooth communication between 2 devices,
but i need to use "Ws2_32.lib" file and i don't know how to do it.
can someone help me?
thanks,eli
|
|
|
|
|
Go to Project->Settings. Under Link tab, add "ws2_32.lib" in Object/Library modules field. Include appropriate header file, in this I think it is "winsock2.h".
Arsalan Malik
|
|
|
|
|
first,thanks for the quick answer.
do i have do write all the path?
the reason i asked this question is because i use the
WSALookupserviceBegin() function,so i included the "winsock2.h"
and in Project->Settings->Link tab i added this path:
C:\Program Files\Microsoft Visual Studio\VC98\Lib\Ws2_32.Lib
but i get this message:
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
also,i forgot to say that i'm developing in embedded visual c++,
but it's not working on visual c++ too.
thanks again,eli.
|
|
|
|
|
hi
i know how i can create several fonts in c++, but i dont know how to get the seperate coordinates. I want to know how many pixel the seperate letters have, and where they are...
i know that my english is not the best, but i hope you understand me ,-)
is there a class which contains all windows fonts?
thanks for help
|
|
|
|
|
HI .
I have a Web Page , i want to access an IP and Port through this Web page . I want to send and recive data on that IP and Port.
1... Is ASP.NET is better for Web page writting.
2... IS i need a web service that Connect to that IP and Port. and send and recive data.
if yes then how can i handle soockets in Web Service.
or is there any otehr way to connect through web page means ATL DLL etc.
my Client is written in VC++ 6 ,with which Web page will connect .
thanx
Regards.
|
|
|
|
|
Iam trying to kill a process in a task bar through VC++ code in another application. How can I do it?
Please advice.
Thanks,
Prem
|
|
|
|
|
TerminateProcess will do the job. You need to get handle to process with PROCESS_TERMINATE access. Use OpenProcess function in windows API.
Arsalan Malik
|
|
|
|
|
Hi all
This is question regarding Font Activation And Font DeActivation. For Font Activation i used AddFontResource() and for DeActivation of fonts RemoveFontResource() .
means Font DeActivation for paricular font ,it does not available in like MS-Word ,Notepad,and For Font Activation it should be available in like MS-Word ,Notepad
It works fine by using AddFontResource((LPCTSTR )sPathName) ,RemoveFontResource((LPCTSTR )sPathName) API,and works only on my system which have win 2000 professional operating system.
But it does not work when we used same application on other system which have also win 2000 professional operating system . what the reasons behind it?
help me........
fefgfgfgfgfg
|
|
|
|
|
Friends,
Can you tell me that how can i get the path of windows directory and windows system directory. There are many API functions that wants such paths. What is the meaning of %system% ??
Imtiaz
|
|
|
|
|
GetWindowsDirectory and GetSystemDirectory do the job, surprisingly enough
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Imtiaz Murtaza wrote:
Can you tell me that how can i get the path of windows directory and windows system directory.
You can also check out SHGetFolderPath(CSIDL_WINDOWS) and SHGetFolderPath(CSIDL_SYSTEM) .
Imtiaz Murtaza wrote:
What is the meaning of %system% ??
It depends on the context in which it is used. In the case of environment variables, the '%' means it's an expandable value.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I'll appreciate any insight, suggestion, or answer to the following problem. Thanks.
I have these two classes, one obtaining data from the other.
class First
{
public:
... // etc.
struct Node
{
short nodeCnt;
... // various other types
} *(*pNode)[7];
...
Second* pSec;
};
==============================
class Second
{
public:
... // etc.
First::Node* (*pNode)[7];
void TransferData(First* pFirst);
...
};
==============================
In the ".cpp" file for 'First', I have a 'DoSomething()' function.
void First::DoSomething()
{
...
pSec->TransferData(this);
...
}
==============================
In the ".cpp" file for 'Second', here is the definition of 'TransferData'.
void Second::TransferData(First* pFirst)
{
...
First::Node* (*pNd)[7] = pFirst->pNode;
... // start transferring data from First::Node to members of class Second.
}
Later in another function for class 'Second', the program crashes.
===============================
void Second::AnotherFunction()
{
short i, nbrOfNodes;
for(i=0; i<limit; ++i)
{
nbrOfNodes = (*(*pNd+i))->nodeCnt; // *** program crashes here !!!
...
}
}
===============================
I can't understand why the program crashes at the place it does, because I have been able to successfully access data from the 'Node' array before, and it didn't crash.
AAMOF, one of those earlier times was in the function 'TransferData' itself, when I had used the same statement:
nbrOfNodes = (*(*pNd+i))->nodeCnt;
inside a different 'for' statement, and it didn't crash.
No, I didn't delete any pointers, nor did I overshot the array boundary, or anything like that. The program crashed the very first time through the loop.
William
Fortes in fide et opere!
|
|
|
|
|
struct Node
{
short nodeCnt;
...
} *(*pNode)[7]; This declares a pointer to an array of pointers to Node objects. How are you allocating memory for this data structure? I'd bet the problem lies there. Could you post the relevant code?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|