?
Solved

Using .MC files in C++ Builder

Posted on 2011-03-08
6
Medium Priority
?
1,344 Views
Last Modified: 2012-05-11
HI, I am hand building a project file in C++ Builder using header and source files from a vcxproj (Visual Studio ) file for an open source library. The VS project has a file with an extension .mc. What exaclty is this file? what does it do? C++ Builder does not seem to know a file type with extension .mc. How  do I work it with c++ builder?
0
Comment
Question by:Mydeen Yussouf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 35095008
Hi there,
First check this out:
http://www.codeguru.com/forum/archive/index.php/t-302816.html
If this is the case we can continue....

George Tokas.
0
 
LVL 1

Author Comment

by:Mydeen Yussouf
ID: 35098282
This link below gives a good overview of MC files and how to use them...

http://rubyforge.org/docman/view.php/85/1734/mc_tutorial.html
0
 
LVL 16

Expert Comment

by:George Tokas
ID: 35098641
So it is just some text used as resource inside a DLL...
Visual Studio creates a DLL to hold that for - lets say, sorry I am Greek and forgive any mistakes - use inside the main application...
The questions are:
Is your application made with C++ Builder loading the DLL??
Do you need the dll or the resource (.res) file?

The above questions are asked because there are and other ways to implement the same functionality but because you are trying to copy code and functionality from VS I have to ask them.

George Tokas.
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 1

Author Comment

by:Mydeen Yussouf
ID: 35130982
@gtokas, can you please highlight the other methods you mention?

THat could be useful as Borland compiler does not seem to have a mc compiler, so I am assuming they follow a different method.
0
 
LVL 16

Expert Comment

by:George Tokas
ID: 35151385
Sorry for the delay.
This particular subject is covered in the magazine I am publishing articles and I will post a compatible way very soon...
First I have to finish my article for this month...:-(
I'll be back tommorow with compatible solution.

George Tokas.
0
 
LVL 16

Accepted Solution

by:
George Tokas earned 1000 total points
ID: 35175045
Hello again,
First of all to use unicode strings as in the sample I am about to show you have to use a version of C++ Builder supports unicode and those are 2006,2009,2010,XE.
The .mc file is a string table resource file...
You are compiling it using MC.exe same way with VS.
There would be as output some .bin files and a .RC file...
Add the .rc file to your project.
This way all .bin files defined inside the .rc file will be linked to the application.
After that you can retrieve the message using:

LPWSTR pMessage = NULL;

  DWORD dwFormatFlags = FORMAT_MESSAGE_FROM_SYSTEM |
                        FORMAT_MESSAGE_FROM_HMODULE |
                        FORMAT_MESSAGE_ALLOCATE_BUFFER;

  va_list args = NULL;
  va_start( args, dwLangId );   // 'dwLangId' is address of last named parameter of called function

  DWORD dwCount = FormatMessage( dwFormatFlags,
                      NULL,           // this app
                      dwMsgId,
                      dwLangId,
                      (LPWSTR)&pMessage,
                      0,
                      &args );

  if( 0 == dwCount )
  {
    ShowMessage( L"Format message failed with " + IntToStr( (__int64) GetLastError()) );
  }

  va_end( args );

George Tokas.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question