I plan to develop a new application with Visual C++ but I am wondering which library to use for the GUI design. I.e. MFC, QT.. and so forth. MFC is a native MS library and sounds nice but rumors say that it has no future. What are your thoughts? Would you start a new application with MFC? Thanks for your answers.
Arris74
Posts
-
What is the MFC future -
How to make member functions of an application accessible by a DLL?Albert, Thank you very much your help. Actually I also want the DLL calls the application's functions. So the idea was to pass a reference or a pointer of the class containing the functions. and to call the functions with that object from within the DLL. I do not know well how work structures. Do you mean that I can do so with a structure without being obliged to put the implementation of the functions in the header file?
-
How to make member functions of an application accessible by a DLL?Hello, If am correct a DLL can access member functions of an application (.EXE)if the implementation is done within the header file (.h) and not within the .cpp. Something like inline functions. Doing so may oblige us to make the source code visible since the header must be supplied with the application. So my question is how to do to avoid this and to make visible only the declaration of the functions. Many thanks for your kind help.
-
How a to expose data of an application (.EXE) to a DLL on runtime?I have got the reason of the problem. Implementation and definition must be in the same file. I.e in the header. But this brings to another problem that is the source code will be disclosed if the application is distributed.
-
How a to expose data of an application (.EXE) to a DLL on runtime?Sure I tried the header alone and the cpp. with the header but linking message is still here. I noticed a curious behavior as following: 1. If I put a comment on the function setval from within my Dll. Then it builds correctly 2. if I remove the comment and I just compile. This works fine as well. 3. Finally if I rebuild the DLL I get the linking errors.
-
How a to expose data of an application (.EXE) to a DLL on runtime?Superman, Please see the code posted to Albert Thread. kind regards.
-
How a to expose data of an application (.EXE) to a DLL on runtime?Hello Albert, Many thanks for your help. Actually my problem is a linking issue. with this message: error LNK2019: unresolved external symbol "public: double __thiscall TestRef::unDouble(double)" (?unDouble@TestRef@@QAENN@Z) referenced in function "public: void __thiscall ClassRef::setval(int)" (?setval@ClassRef@@QAEXH@Z) MYDLL.obj fatal error LNK1120: 1 unresolved externals Debug/MYDLL.dll My Dll function has a pointer as parameter and the pointer calls the function member of the application's class and that function uses an object of another class of the application. Could you please tell me how to solve it? Below is the sample source of the DLL function
#include "classref.h" // file header of the application using the DLL
extern "C" __declspec(dllexport) int MainEntry( ClassRef* pRef )
{
// entier is a public attribute of the application that uses the DLL
int XX = pRef->entier; // This works//getval is a public member function of the application that uses the DLL XX = pRef->setval(5); // compile but does not build. unresolved external symbol errors
return 0;
}And below is definition of setval(int )
void setval( int val)
{
double dbl = m_ref->unDouble(16.45);// This is a member function of another class of the application
entier = val * dbl ;
} -
How a to expose data of an application (.EXE) to a DLL on runtime?Data is contained in arrays which objects are instances of classes of the application. I have tried to pass a reference of the object in the exported function but the parameter type is not known by the DLL. I also tried to make the header file visible to the DLL and set a #include "myfile.h" in the DLL but this does not work.
-
How a to expose data of an application (.EXE) to a DLL on runtime?Hello, I have an application that uses a DLL but the DLL needs to access data provided by the application on runtime. Tryng to make .exe objects visible to the DLL brings me to awful linking problems The solution I tested is to use COM but this forces to use RPC for communication between the .DLL and the .EXE world. COM solution sounds complex and out-proc is slower than in-proc. Please could you help me with a more simple solution? Thank you in advance
-
Compiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help.Hello dear ATL experts, While trying to compile a VC++ 6.0 project with VC++ 7.1, I have got the following error : d:\TESTINGONLY\dbstudio\DSIFormat.h(58) : error C2664: '_com_ptr_t<_IIID>::_com_ptr_t(int)' : cannot convert parameter 1 from 'ATL::CComPtr<T>' to 'int' with [ _IIID=_com_IIID<StdFormat::IStdDataFormatDisp,& _GUID_6c51b910_900b_11d0_9484_00a0c91110ed> ] and [ T=StdFormat::IStdDataFormatDisp ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called This error is caused by the following instanciation CComPtrStdFormat::IStdDataFormatDisp m_fmtBinary; StdFormat::IStdDataFormatDisp is located in a .tlh file. I am a newbee with COM and I guess it is an interface generated by the compiler. Here is its definition struct __declspec(uuid("6c51b910-900b-11d0-9484-00a0c91110ed")) IStdDataFormatDisp : IDataFormatDisp { // // Property data // __declspec(property(get=GetType,put=PutType)) enum FormatType Type; __declspec(property(get=GetFormat,put=PutFormat)) _bstr_t Format; } It derives from struct __declspec(uuid("e675f3f0-91b5-11d0-9484-00a0c91110ed")) IDataFormatDisp : IDispatch {}; IDataFormatDisp does nothing so I wonder why not deriving IStdDataFormatDisp direcly from IDispatch Indeed the project works fine with visual c++ 6.0. I thank you very much for your help.
-
Compiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help.Hello dear COM experts, While trying to compile a VC++ 6.0 project with VC++ 7.1, I have got the following error : d:\TESTINGONLY\dbstudio\DSIFormat.h(58) : error C2664: '_com_ptr_t<_IIID>::_com_ptr_t(int)' : cannot convert parameter 1 from 'ATL::CComPtr' to 'int' with [ _IIID=_com_IIID ] and [ T=StdFormat::IStdDataFormatDisp ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called This error is caused by the following instanciation CComPtr m_fmtBinary; StdFormat::IStdDataFormatDisp is located in a .tlh file. I am a newbee with COM and I guess it is an interface generated by the compiler. Here is its definition struct __declspec(uuid("6c51b910-900b-11d0-9484-00a0c91110ed")) IStdDataFormatDisp : IDataFormatDisp { // // Property data // __declspec(property(get=GetType,put=PutType)) enum FormatType Type; __declspec(property(get=GetFormat,put=PutFormat)) _bstr_t Format; } It derives from struct __declspec(uuid("e675f3f0-91b5-11d0-9484-00a0c91110ed")) IDataFormatDisp : IDispatch {}; IDataFormatDisp does nothing so I wonder why not deriving IStdDataFormatDisp direcly from IDispatch:confused: Indeed the project works fine with visual c++ 6.0. I thank you very much for your help.
-
Request Zip-Unzip C++ libraryThnks for help. I've got several interesting libraries that I am pleased to share with you. Here are the links. But for the moment I do not know which is the best. http://www.codeproject.com/KB/library/LiteZip.aspx http://www.codeproject.com/KB/cpp/xzipunzip.aspx http://www.winimage.com/zLibDll/ http://www.info-zip.org/UnZip.html http://www.7-zip.org/ http://www.bzip.org/
-
C++ to mathlabIf I correctly understand. you would like to use your VC++ code from within Matlab. Right? A solution is to turn your VC++ code into mex files. The benefit is that this will speed up the execution within matlab. I know there is a tool called MexWizard. Have a look at www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=1368&objectType=file Hope that answers to your question. regards
-
Request Zip-Unzip C++ libraryHello, Sorry if it is not the right place for a such request. I am looking for C++ library compression and decompression files, supporting at least Zip and Rar format, with source code under lgpl licence. Could you please suggest me one? I thank you very much.
-
Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?Mark, Sorry for the confusion, I am not clear with my problem. Let me give an example. Suppose the user of my application type-in some data from within an edit control. This calls a function which calls a 2nd function and finally a 3rd function is called. But the 3rd function rejects the data entered by the user. It returns a message to the user. The user clicks on OK and finally gets the hand on the application. So the unique solution I've found is _c_exit() that terminates the procedure and gives the hand to the application without closing it. But is does not work in debug mode. Any idea?
-
Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?I use _c_exit() It allows me to exit from a procedure/process without closing the application.
-
Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?Hello, The following functions _cexit, _c_exit, exit and _exit works fine on release mode but in debug mode the processes/procedures are not terminated when the functions are called. I use VS 2003 and I use both managed and unmanaged code. Anyway I tried those functions with #pragma managed and #pragma unmanaged but the problem is the same. Do you know why and how to make them working on debug mode? Thanks for your help.
-
Write a string find and replace programCan this help to start? http://www.codeguru.com/forum/showthread.php?t=426623&highlight=functions
-
[Message Deleted]Does this link help? http://www.codeproject.com/cpp/ymatrix.asp
-
Parsing and Invoking functions problemHello, The following code snippet invokes a function by its name. It works fine but the function's name and its arguments must be used separately. What I would like to do is to type in my function from an edit control as it is defined E.g. MyFunc(arg1, arg2). But before invoking it, I assume that I must parse it to get its name and arguments separately. So I am wondering if Dot.Net framework provides either a parsing method that will easily split the function name and the arguments or better an invoke method where I can just pass my function in one shot with all its arguments? Could you please help me to find a straightforward solution?
Object* CInvoker::InvokeMethod(String* method, Object* args[]) { Module* module[] = Assembly::GetExecutingAssembly()->GetModules(false); CExternal* objexternal = new CExternal();//The instance that encapsulates the function to invoke Type* typExternal = module[0]->GetType("CExternal"); MethodInfo* methodinf = typExternal->GetMethod(method); Object* ret = methodinf->Invoke(objexternal, args); return ret; }