|
how do I find out the current path that my executable is executing in? Thanks
If it's broken, I probably did it
bdiamond
|
|
|
|
|
|
No, this is wrong. This will get the path the executable is currently "working" in. Might be as well C:\Windows or any other directory.
What you want is GetModulePath .
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks!!! the other solution gave me the last path that the user browsed to with my 'File Open' dialog.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
using simple sockets how can you test if the connection has been broken by the other server?
|
|
|
|
|
try to receive data and if it fails check call WSAGetLastError and then you will see if the connection was closed.
Don't try it, just do it!
|
|
|
|
|
Hey all,
I have some problems when I try to load a DLL file, I m using afxloadlibrary cause I need to work with multithreads... when I compile everything goes ok, but when I execute I get this error messagebox
Debug Assertion Failed!
Program ...\ewcapt.exe
File appcore.cpp
Line 85
does anyone know what it means?
Daniel
|
|
|
|
|
Is the DLL being loaded an MFC extenbsion DLL? If so, are AfxInitExtensionModule() and AfxTermExtensionModule() being used?
danielsdl wrote:
File appcore.cpp
Line 85
does anyone know what it means?
Have you set a breakpoint on line 85 of appcore.cpp to see why the assertion is firing?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Debug -vs- Release?
Make sure the dll and the executable are compiled for the same type.
Brad Bruce
|
|
|
|
|
Thank u guys... the problem was that I declared a pointer as a member of my class inside my dll, I dont know why, it doesnt work when u have a pointer variable...
|
|
|
|
|
if i want to implement a firewall with windows apis for
processing each input/output packet please introduce me that apis (if there is)
koosha
|
|
|
|
|
|
First some details:
Our application receives a data feed over a fiber optic T1. We develop both the client and server applications that send and receive the data. Both applications are written in ANSII C++ for portability. We use Winsock when running on a Windows platform.
The problem:
Sometimes the T1 line experiences 25% loss according to the ping tool. During these times we often see our connection from client to server disconnect with an error 10054 (An existing connection was forcibly closed by the remote host.). Is there anything we can do, programatically, to avoid connection loss or to quickly recover from the connection loss?
Thanks in advance
|
|
|
|
|
Hi
is it dangerous to have many threads read one shared variable/object without using any synchronization mechanisms?
(read only)
this variable can be a static or a regular member of a class...
|
|
|
|
|
You are not changing anywhere this variable?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
no
just a global variable that i set before i begin any threads..
after threads begin..they just need to read the variable/object.
|
|
|
|
|
And in the object, are they changing any data concurently?
Or its just read read situation?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
a read read situation..
just in case that i change any data .. i use make synchronization inside the function that make the change.
|
|
|
|
|
Shouldn't have a problem.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks..
just wanted to make sure
|
|
|
|
|
If there is any chance that some threads might be READING the data while others are changing it EVER, then you will have trouble unless you synchorize the readers ALONG with the writers.
If the data is only written before any of your reader threads start up, you are safe.
|
|
|
|
|
I can't get Chris Maunder's grid control to work. Get this:
Linking...
GridCtrl.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CTitleTip::~CTitleTip(void)" (??1CTitleTip@@UAE@XZ) referenced in function __unwindfunclet$??0CGridCtrl@@QAE@HHHH@Z$0
GridCtrl.obj : error LNK2019: unresolved external symbol "public: __thiscall CTitleTip::CTitleTip(void)" (??0CTitleTip@@QAE@XZ) referenced in function "public: __thiscall CGridCtrl::CGridCtrl(int,int,int,int)" (??0CGridCtrl@@QAE@HHHH@Z)
GridCtrl.obj : error LNK2019: unresolved external symbol "public: void __thiscall CTitleTip::Hide(void)" (?Hide@CTitleTip@@QAEXXZ) referenced in function "protected: void __thiscall CGridCtrl::OnHScroll(unsigned int,unsigned int,class CScrollBar *)" (?OnHScroll@CGridCtrl@@IAEXIIPAVCScrollBar@@@Z)
GridCtrl.obj : error LNK2019: unresolved external symbol "public: void __thiscall CTitleTip::Show(class CRect,char const *,int,struct tagRECT *,struct tagLOGFONTA const *,unsigned long,unsigned long)" (?Show@CTitleTip@@QAEXVCRect@@PBDHPAUtagRECT@@PBUtagLOGFONTA@@KK@Z) referenced in function "protected: void __thiscall CGridCtrl::OnMouseMove(unsigned int,class CPoint)" (?OnMouseMove@CGridCtrl@@IAEXIVCPoint@@@Z)
Debug/gc.exe : fatal error LNK1120: 4 unresolved externals
Help!!!!!!!!!1
|
|
|
|
|
Seems like a file is missing from the project
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I've used the AfxbeginThread function before with a global function, but is there a way I can use it with a member function of the object it's operating in? When I try to use it here, I get the following error message:
error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'UINT (LPVOID)'
and here is the function declaration:
UINT Parse( LPVOID pParam );
If it's broken, I probably did it
bdiamond
|
|
|
|
|
declare it as a static function
A member function has a thiscall convention, so it has an additional this parameter passed.
When you declare it static this wont be passed anymore, thus fixing your problem
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|