|
I assume that the original 32-bit code used VB6-specific control elements, that the source code (text) for the RC file is unavailable, and that you are familiar with the .RC (source code for resources) file format.
To my knowledge, there is no fully automated method of performing the conversion. What you must do is the following:
- Extract the resources from the .EXE file using a resource file editor.
I have used ResEdit (freeware) for examining resources in EXE files. IIRC, it can also extract resources from an EXE/DLL. - Convert any VB6-specific elements to generic Windows versions
Each dialog etc. specifies its "class" type, which affects how it is displayed. This includes the DLL that must be loaded in order to display it. Convert any VB6-specific names to the generic equivalent (e.g. "VB6button" should be renamed "button", "VB6dialog" should be renamed "dialog", etc.) - EDIT: Some ActiveX controls may have no generic control that can replace them. In this case, you must decide whether to use a class library that supplies the missing functionality, or eliminate them from the file.
- Recompile the RC file using the Visual Studio resource editor.
You should get an application that has standard dialog boxes. It will presumably require lots of tweaking before the layout etc. looks OK, but it is a good starting point.
Good luck!
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
As much as I understand:
Non-MFC projects / Projects with ATL support use CString via atlstr.h
MFC projects use CString via cstringt.h
They are source-code compatible, bbut not link time compatible; so if I have a static library that does use CString and that I want to use in both an MFC and a non-MFC project, I have to build the library in two configurations - with / without MFC support.
Is there any sane way to build the library and link it to both MFC and non-MFC projects?
|
|
|
|
|
Remove the CString dependency (i.e. use std::string or something else)... as easy CString is to use, they sure jumbled things up by essentially including it in two places (which is what I assume the link time portion means). Now, I am assuming that's what they mean by "not being link-time compatible" means. You can verify by using a tools to look for the CString symbols in either library (in linux you'd use the "nm" utility, there must be a Windows equivalent but not sure of the name).
|
|
|
|
|
i am getting error
error : expected unqualified-id
public ref class Form1 : public System::Windows::Forms::Form
^
error : expected unqualified-id
[STAThreadAttribute]
^
error : use of undeclared identifier 'STAThreadAttribute'
[STAThreadAttribute]
^
3 errors generated.
i am using clang compiler to build the project
what could be the possible reasons for this? How could I solve this?
thanks
|
|
|
|
|
Check the preceding lines to see if there is an incomplete statement.
|
|
|
|
|
there is only pragma and namespace above the error-ed public keyword-
#pragma once
namespace test4 {
namespace System{};
namespace System{namespace ComponentModel{}};
namespace System{namespace Collections{}};
namespace System{namespace Windows{namespace Forms{}}};
namespace System{namespace Data{}};
namespace System{namespace Drawing{}};
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
error is not shown above the public keyword
I had replaced-
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
with
namespace System{};
namespace System{namespace ComponentModel{}};
namespace System{namespace Collections{}};
namespace System{namespace Windows{namespace Forms{}}};
namespace System{namespace Data{}};
namespace System{namespace Drawing{}};
because i was getting error with the first one.
|
|
|
|
|
Those changes are completely wrong. You have removed the using keywords, and added lots of unnecessary brace characters. I suggest you create a new clean Form project from the Visual Studio templates.
|
|
|
|
|
Hi,
If I use using then I get the following errors-
error : expected namespace name
using namespace System; ^
error : use of undeclared identifier
using namespace System::ComponentModel;
^
error : expected namespace name
using namespace System::ComponentModel;
^
error : use of undeclared identifier
using namespace System::Collections;
^
and so on....including buttons...
So, I used the namespace with curly braces{} suggested somewhere on the net
Using that I don't get these errors but then I have trouble with Public keyword.
what can I do? Is clang compiler doing this?
|
|
|
|
|
VScoder12 wrote: So, I used the namespace with curly braces{} suggested somewhere on the net Don't. Using information from the internet without knowing what you are doing is not the way to get your program to work.
I am beginning to suspect that you are not using the CLR option on your project, so the compiler thinks this is unmanaged C++. Check your settings again.
|
|
|
|
|
I used Visual C++ > CLR > Windows Forms Application in my project creation
I think it is not recognizing the System namespace
If I use curly braces i think it recognizes System namespace but then it does not recognize the Private keyword
any suggestion?
|
|
|
|
|
VScoder12 wrote: any suggestion? Not really. I have just created a new Windows Forms application using Visual C++ 2010 Express, and it creates the correct files, and compiles without error. I can only assume that something is missing from your Visula Studio setup that causes these errors. The generated code of the two main files is as follows, you could try it in your system.:
#pragma once
namespace WinForm {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
~Form1()
{
if (components)
{
delete components;
}
}
private:
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
void InitializeComponent(void)
{
this->components = gcnew System::ComponentModel::Container();
this->Size = System::Drawing::Size(300,300);
this->Text = L"Form1";
this->Padding = System::Windows::Forms::Padding(0);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
}
#pragma endregion
};
}
#include "stdafx.h"
#include "Form1.h"
using namespace WinForm;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1());
return 0;
}
|
|
|
|
|
if i use win32 then mine also compile and runs successfully
but i am having trouble with compiling/building with clang compiler as mentioned earlier
|
|
|
|
|
Clang doesn't support C++/CLI, while Microsoft's compilers do. That's the issue.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
VScoder12 wrote: clang compiler What is that, and what does it have to do with Visula Studio?
|
|
|
|
|
Clang Compiler[^]
An open-source compiler.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Yeah, I missed the significance of that in the opening question.
|
|
|
|
|
|
I implemented a multi language UI in a MFC program, since only a few controls, so I write translation in code, I knew it can be implemented with DLL, or String Table.
Now I wonder what way is better, in code, string table, or DLL,according to run time performance and space consuming.
|
|
|
|
|
If your program isn't huge, no reason to do this in an external library, that would definitely be the slowest and most (disk) space consuming method.
I'd say string table would probably be fast, and as long as you don't have too many strings, it shouldn't be too costly. If you have a huge number of strings, you may start using up quite a bit of memory to support this, then the library method starts to become more appealing.
|
|
|
|
|
Hello everyone,
I meet a crash problem. just as following, I donot know why IsWindow will crash,
Is there anyone meet the same problem?
AULTING_IP:
user32!IsWindow+1a
761a7150 8365fc00 and dword ptr [ebp-4],0
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 761a7150 (user32!IsWindow+0x0000001a)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000001
Parameter[1]: fffffffc
Attempt to write to address fffffffc
ChildEBP RetAddr Args to Child
06f9ff48 72d229bb 04e73a50 6928d287 00000000 user32!IsWindow+0x1a
06f9ff80 72d22a47 00000000 7710338a 04e74990 msvcr80!_callthreadstartex+0x1b [f:\sp\vctools\crt_bld\self_x86\crt\src\threadex.c @ 348]
06f9ff88 7710338a 04e74990 06f9ffd4 776b9f72 msvcr80!_threadstartex+0x66 [f:\sp\vctools\crt_bld\self_x86\crt\src\threadex.c @ 326]
06f9ff94 776b9f72 04e74990 70af11ab 00000000 kernel32!BaseThreadInitThunk+0xe
06f9ffd4 776b9f45 72d229e1 04e74990 00000000 ntdll!__RtlUserThreadStart+0x70
06f9ffec 00000000 72d229e1 04e74990 00000000 ntdll!_RtlUserThreadStart+0x1b
|
|
|
|
|
Please show the code that causes the error, it looks as if you are passing a bad parameter to some windows function.
|
|
|
|
|
Further questions:
- the window handle you feed into IsWindow: is it a handle inside your application or a different window?
- is your application running elevated?
- is the other application running elevated?
- are there differences in 32 vs. 64bit architecture between the applications?
|
|
|
|
|
Windows XP, Visual Studio 2008, MFC, Cpp
Note: I am hoping that someone recognizes this basic class of problems and can advise me without additional details. If needed, tell me what additional details are required.
I cannot copy/paste from my working computer so please excuse any obvious typos.
Basic Problem:
I added a simple stand alone function to my project and cannot get Visual Studio to compile it.
Setup:
Application AR2_IADS_Client_Simlulator is located in E:\VISUAL_STUDIO\AR2_IADS_Client_Simulator.
This directory: E:\VISUAL_STUDIO\COMMON_CODE contains classes and code that is used by multiple solutions and projects.
In the Solution Explorer, project AR2_IADS_Client_Simulator I right clicked on the Header Files part of the project and added a new dot h file named: Log_One_TCP_Packet.h. It was placed in the COMMON_CODE directory. It looks like this:
#include "stdafx.h"
#include "C_Log_Writer.h"
Void Log_One_TCP_Packet( … arguments );
The same was done in section Source Files and file Log_One_TCP_Packet.h.cpp was also created in COMMON_CODE. It begins like this:
#include "stdafx.h"
#include "Log_One_TCP_Packet.h"
Void Log_One_TCP_Packet( … arguments )
{ … }
Action:
The cpp file is open in VS and is in focus. Press ctl-F7 to compile it.
The error messages state:
Quote: Warning C4627 #include “stdafx.h” skipped when looking for precompiled header use.
Warning C4627 #include “Log_One_TCP_Packet.h” skipped when looking for precompiled header use.
Fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ‘#include “stdafx.h”’ to your soruce?
I don’t know of any option such as: #include_and_do_not_skip “Log_One_TCP_Packet.h”
There is no button I can select that says: “No! I did not forget. Its right there in the source code.”
There are already several classes in COMMON_CODE used by this project. The directory is referenced in
Quote: Properties -> Configuration Properties -> C/C++ -> Additional Include Directories.
Questions
Must this function be made into a stand-alone class just for this one function?
How might I get VS to recognize and compile it?
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
Did you try cleaning and rebuilding the whole project?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Rats. Its so easy to forget the easy stuff. No, I did not. I will try that at work tomorrow. But I did make a class out of it and that worked just fine.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|