|
toxcct wrote:
why did you copy the .RC file ???
I created the .rc file i.e. added it to the project
then the dialog is added as a child of the .rc file
Am I doing this all wrong?
Can you step me through what you would do to add a dialog with a button?
Cheers
|
|
|
|
|
|
TheProffessor wrote:
I am trying to add a dialog to an existing project.
Exactly how did you do this?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
#include"resource.h" didn't work
still get the same error
error C2065: 'IDD_SHUTDOWN' : undeclared identifier
|
|
|
|
|
|
ThatsAlok wrote:
Then Check wheather IDD_SHUTDOWN is defined in Resource.h or not!
It wasn't defined! But now I get lots of errors saying that everything is already defined in a .obj file.
????
|
|
|
|
|
Hi,
How can implement Windows Explorer-style folder tree view?
Would any one give me a hint?
Regards.
|
|
|
|
|
|
Thank you!
And would you let me know how can implement Explorer-style file list view?
Regards.
|
|
|
|
|
Sorry, I'm not your personal teacher and I'm not doing your homework for you.
If you're too lazy to search an article yourself, then I can't help you anymore.
Don't try it, just do it!
|
|
|
|
|
HI ,
I was just trying to create a tool box application but suddenly realised that i have no ideahow to go about doing it.
If somebody could guide me how i can go about implementing it I would be very happy to learn and try it out.
thanks
U get wht u Give
|
|
|
|
|
What's a toolbox ?
something part of an existing application you are building or something new ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have to build my own tool box.
U get wht u Give
|
|
|
|
|
I am new to C++ and I am trying to write a small program that would backup an access database file from the hard drive to a zip drive.
I would appreciate any help.
Thank you.
|
|
|
|
|
Sounds very much like "do my homework for me please".
But I don't care....
Get a library for creating zip files from the internet, and use it.. that is the rough description of what you have to do.
Don't try it, just do it!
|
|
|
|
|
Sorry I have not been in school for a long time....., I have not used C++ for a few years and was trying to relearn it. I have been trying to figure out how to use the ifstream and ofstream with no luck.
|
|
|
|
|
Can't you use CopyFile() or SHFileOperation() ? If not, then I guess I don't understand the question. Is there something special about a Zip drive (I've never used one)? Don't you just copy files to it like any other drive?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Nothing special about ZIP drive, except you might (more like probably) get error if no disk is in it. Otherwise, pretty much just like a floppy or any other read/rite drive. I also suspect the CopyFile or SHFileOperation will work just fine.
|
|
|
|
|
Hi,
I need to write dll for another MFC application.
I've wrote the dll using MFC DLL wizard (regular dll using shared MFC dll).
In my DLL header there is th followung declarations:
#define TCPDLL_API __declspec(dllexport)
TCPDLL_API int WINAPI FLRInitializeIP(IPStruct *Server,int num_of_radars);
and in my "dll.def" there is the next declaration:
FLRInitializeIP @1
Also,the implementation of the function is:
TCPDLL_API int WINAPI FLRInitializeIP(IPStruct *Server ,int num_of_radars)
{
struct hostent *Host;
SIZE_T t=100;
char *host_name = new char[100];
gethostname(host_name,t);
Host = gethostbyname(host_name);
Server->HostIP = inet_ntoa(*((struct in_addr*)Host->h_addr));
delete []host_name;
Server->Num_Of_Connected_Clients = 0;
Server->ListeningSocket = INVALID_SOCKET;
Server->Num_Of_Radars = num_of_radars;
if(CreateTCPServerSocket(Server) != LISTEN_SUCCESS)
return 0;
return 1;
}
Finally,I'm using the dll :
typedef int (CALLBACK* FLRInitializeIP_PROCCESS)(IPStruct* ,int);
void CDLLTestDlg::OnListenButton()
{
HINSTANCE hLib;
FLRInitializeIP_PROCCESS FLRInitializeIP;
IPStruct Server;
int result;
hLib = LoadLibrary("TCP_DLL.dll");
FLRInitializeIP = (FLRInitializeIP_PROCCESS)GetProcAddress(hLib,"FLRInitializeIP");
result = FLRInitializeIP(&Server , 1);
m_List.AddString(Server.HostIP);
FreeLibrary(hLib);
}
Well,I don't get compilation errors,but if the return value
of FLRInitializeIP() is anything else but "void"- i get run time error(something about convention error...).
But, if the return value is "void" there is no error.
When i'm debugging my code - the function works fine and the
error accurs after
return 0
or
return 1
Can anyone help me with this error?
Is there good tutorial about dll programing?
Maybe I've wrote the wrong DLL project?
Regards,
Eli
|
|
|
|
|
Why are you using a MFC dll for a function that does not use MFC?
Don't try it, just do it!
|
|
|
|
|
well - you see only one function from the DLL.
in other functions i use MFC object(i.e CString....).
|
|
|
|
|
Hi Eli,
Your "dll.def" should look like below
FLRInitializeIP
And also the declearation of function should be like this:
int WINAPI FLRInitializeIP(IPStruct *Server ,int num_of_radars);
It might solve ur problem.
Cheers,
Vishal
|
|
|
|
|
Hi,
I need to write dll for another MFC application.
I've wrote the dll using MFC DLL wizard (regular dll using shared MFC dll).
in my DLL header there is th followung declarations:
#define TCPDLL_API __declspec(dllexport)
TCPDLL_API int WINAPI FLRInitializeIP(IPStruct *Server,int num_of_radars);
and in my "dll.def" there is the next declaration:
FLRInitializeIP @1
also,the implementation of the function is:
TCPDLL_API int WINAPI FLRInitializeIP(IPStruct *Server ,int num_of_radars)
{
struct hostent *Host;
SIZE_T t=100;
char *host_name = new char[100];
gethostname(host_name,t);
Host = gethostbyname(host_name);
Server->HostIP = inet_ntoa(*((struct in_addr*)Host->h_addr));
delete []host_name;
Server->ListeningSocket = INVALID_SOCKET;
Server->Num_Of_Radars = num_of_radars;
if(CreateTCPServerSocket(Server) != LISTEN_SUCCESS) return 0;
return 1;
finally,í'm using the dll :
typedef int (CALLBACK* FLRInitializeIP_PROCCESS)(IPStruct* ,int);void CDLLTestDlg::OnListenButton() { HINSTANCE hLib; FLRInitializeIP_PROCCESS FLRInitializeIP; IPStruct Server; int result; hLib = LoadLibrary("TCP_DLL.dll"); FLRInitializeIP = (FLRInitializeIP_PROCCESS)GetProcAddress(hLib,"FLRInitializeIP");
|
|
|
|
|
That's nice...
Hum, ..... and what's the question ??
|
|
|
|
|
I've wanted to edit my question and i clicked the "submit" button instead of the "preview" button.
The correct message is above.
Regards,
Eli:->
|
|
|
|