|
Well, that's nice but more information about the exact error you get would be nice. Is it a runtime error (I suppose so because you said that you try to use the dll in delphi, meaning that you probably compiled it successfully).
Also, when you post code, use the pre formating tag (juste above the emoticons).
|
|
|
|
|
Cedric Moonen thanks for your reply.
I want develope one DLL in VC6 and create CAsyncSocket in Dll , this DLL is client for my service , DLL must be use all programming environment same as delphi , vb ,...
When create one variable from CAsyncSocket in DLL(ConnectToServer function) and call this function (ConnectToServer ) in delphi , get Error CASocket1.create() line.
please tell me you and others advance how create one class from CAsyncsocket im my DLL project.
Thanks.
|
|
|
|
|
Just guessing, since you haven't indicated what error occurs...
The DLL uses MFC so are you initializing MFC properly for a DLL?
CAsyncSocket, by default, requires a window (used internally by the class) so there can
be problems if MFC is not initialized.
Mark
|
|
|
|
|
I test my DLL in machine write DLL , so that MFC and also visual C are install.
|
|
|
|
|
Right. But, CAsyncSocket is an MFC class, so MFC needs to be initialized on the DLL.
Also, you'll need an MFC message loop on a thread somewhere to handle the windows messages.
Why not just use the Sockets APIs? CAsyncSocket is just a thin wrapper around them anyway.
Mark
|
|
|
|
|
Thanks,
I didn't work with Socket APIs as yet , let me know if you have any samples or
guide me anyway .
|
|
|
|
|
hameduser wrote: I didn't work with Socket APIs as yet , let me know if you have any samples or
guide me anyway .
You'd need to understand sockets to use CAsyncSocket as well.
Here's the Microsoft documentation: Windows Sockets 2[^]
Here's links to many articles: CP Search Articles[^]
Mark
|
|
|
|
|
char folder[] = "C:\\My_Folder\\";
char *oldFile;
int old = 1;
sprintf(oldFile, "%sMyFile%02d.xml", folder, old);
if( remove(oldFile)
{
sprintf(text, " { Error } Failed to remove %s.", oldFile);
LOG(text);
}
Even "C:\My_Folder\MyFile01.xml" is valid path, remove() failes to delete this file.
What should I use?( file is not read-only )
Why failed to remove the file?
|
|
|
|
|
Aniket Salunkhe wrote: char *oldFile;
Try to change the line to this:
char oldFile[MAX_PATH];
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I think first u hav to chk for access rights
..... if access rights r fine
then
try this...
char oldFile[512]; instead of char *oldFile
Hope this will help u ...
|
|
|
|
|
Even when I use
remove("C:\\My_Folder\\My_Files.xml");
File is not get deleted.
Also I tried using 'DeleteFile()' function.
( not deleting the file everytime)
What is the reason & solution?
|
|
|
|
|
Did you use of this file on your program?
|
|
|
|
|
Sorry to all.
Once the file opened to read data from it was,t closed properly. Because of which problem was generated.
Now it's working fine after closing the file properly.
Thanks to all of you.
|
|
|
|
|
|
You can also use of MoveFile
|
|
|
|
|
Hi,
I wann to connect to SFTP server using MFC .
How can I do that
Thank you
Sandeep
|
|
|
|
|
Hi all
I have the mother of all doubts - Whats the difference between normal C++ and managed one ?
Preciously I would like to know if I work with VC++ 6.0 is it managed c++ or unmanaged one ?
What about .NET VC++ ?
Can anyone tell me pls ?
redindian
|
|
|
|
|
|
Code genrated by VC++ 6.0 is unmanaged code and code generated by VC++.Net is managed code.
Regards
Atool
M.Atool
|
|
|
|
|
Not true
Code managed by VC.NET CAN be managed code, if you ask it to be. By default, it is not.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
Hi all,
I am troubling to convert from CString to char* in both unicode and debug mode.
//Snippet of code.
--------------------------------------------------------------------------
CString str = "this is a test";
char* pchar = new char[str.GetLength() + 1];
now how to store the string "this is a test" in pchar character pointer.
//-------------------------------------------------------------------------
Uday kiran
|
|
|
|
|
|
And then use of ReleaseBuffer()
|
|
|
|
|
GetBuffer a pointer to the internal CString buffer. it is not a good idea to get this modifiable buffer only if a conversion to char* is needed.
there are cast operators for that : (LPCTSTR) for instance.
|
|
|
|