|
Hey,
thanks
it's just what i wanted....
i guess i need to read a lot...
Regards,
Abhijeet
|
|
|
|
|
Hello !!
I have encountered some problem to make a project in MFC .
There is a particular text(T) is displayed in a text box control.
I want to create an window(W) as the mouse pointer focues at that particular text (T).
This window(W)pane should display some string data .
Would you please give me some solution ?
GargiBag
|
|
|
|
|
hi...
i am doin files drag & drop operation. in that i have a dialog box,which include treectrl. i need to drop a file in the treectrl... I already did this using view class...
but now i need to do it in a dialog class...
how to do that....
Thanks in advance
|
|
|
|
|
Has anyone have any thoughts on converting a Borland C++ Builder project to MS VS 2005 ? I don’t know anything about Borland’s environment but we have acquired a company that does all it’s software using Borland. We are strictly an MS environment group. The project is a simple MDI application, no .NET.
Are there any blogs, papers, etc on the subject ?
Thanks in advance
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Depends on the size of Borland project, if it is really simple rewriting is good but if the project is a complex application at least I don't recommend that.
|
|
|
|
|
Tony Teveris wrote: converting a Borland C++ Builder project to MS VS 2005 ?
Well when you say "converting a project" do you mean the IDE project management files? I know it might be tedious but you should be able to just create an empty VS project and add all the files and libraries by hand. If that is not what you are asking about could you be more specific?
|
|
|
|
|
This is exactly what I have been doing for the last 4.5 months. I was hired on to port an application from Borland to VS 2005 with some C# sprinkled in there. To be more specific, I am porting from Borland OWL.
Are you using OWL? Sorry, I am not familiar with Borland C++ Builder or the Borland tools. I'm just porting code and we use a makefile to compile the Borland code.
I can give you some pointers if you are using OWL. A lot of the classes and methods transfer quite easily to MFC. Things like TDC is a CDC, TPen is a CPen. There are other portions of Borland which are nice and make you wish MFC had the same thing. For example, Borland has an actual color class (TColor). There is no equivalent in MFC so I had to use a COLORREF and the RGB macros in place of TColor.
There are other helpful Borland classes which you just need to figure out how to do the equivalent in MFC.
Since you will be working with MDI, you should be aware of Borland's window structure. Do you have a background in MFC and how the window classes relate? In MFC, a window contains a MainFrame which itself controls the MDIClient window. These are one-in-the-same when it comes to MFC classes. In Borland, you actually have two separate classes. A TMDIClient class and TMDIFrame/TDecoratedMDIFrame. You will need to convert the two classes into the one CMDIFrameWnd.
Does the project use STL? The STL is different between the two and requires some minor name changes. A compile error will point this out and you can usually figure out the equivalent just looking it up on MSDN.
Unfortunately, there is really no information on-line for Borland information. I use their OWL help documentation if I ever get stuck.
This should at least give you a heads up. Let me know if you have any more questions or concerns. We can take this to e-mail if necessary.
|
|
|
|
|
Hi
For example i have a dll code like this:
class __declspec(dllexport) CDllTest<br />
{<br />
public: <br />
CDllTest(){}<br />
~CDllTest(){}<br />
<br />
public:<br />
void SayHello();<br />
};<br />
<br />
<br />
void CDllTest::SayHello()<br />
{<br />
printf(_T("Hello C++"));<br />
}
Here:
After exporting classes how do I access it's member function from another module by using run time dynamic linking (LoadLibrary, GetProcAddress...)?
What are the techniques/ways calling a class member function from exe?
Thanks..
|
|
|
|
|
sawerr wrote: After exporting classes how do I access it's member function from another module by using run time dynamic linking (LoadLibrary, GetProcAddress...)?
You won't be able to import classes using explicit linking (meaning by using LoadLibrary and GetProcAddress). Instead you need to use implicit linking: link to the lib file that was generated with the dll and include the header file in which the class is declared (in that case, you need to import the class).
There is a bunch of articles here[^] to help you.
|
|
|
|
|
Cedric Moonen wrote: You won't be able to import classes using explicit linking
why that ?
i think you say so because of the mangled names, but if the .DEF file is present, no pb anymore...
am i right ?
|
|
|
|
|
Actually I don't even get the OP's question...
Does he really want to have the function body in the EXE, but the declaration in the DLL?
Would that even compile?
I wonder what ::GetProcAddress() would return...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
no, i think he just wants to load his DLL dynamically, but he doesn't know what to put as the parameter to ::GetProcAddress() when the function is a member of a class.
but the trick is that he only has to load the class...
|
|
|
|
|
toxcct wrote: am i right ?
I don't think so. Using GetProcAddress, you can get the address of a function, but you are not able to import a complete class (as far as I know). How would you that ? Or maybe I am missing something...
|
|
|
|
|
|
Do you need to use explicit linking ? Why don't you go for the standard way, e.g. implicit linking ?
Of course, you have a little more things under control but do you really need that ? It is only really usefull when you develop a kind of plugin...
|
|
|
|
|
ahhhh, codeguru... lol
see here[^] if that helps.
|
|
|
|
|
hum, yeah, you're right... a class to be used must be known its definition at compile time...
|
|
|
|
|
Hello,
Can you tell me how to use InitModalIndirect() function of CDialog class?
And what exactly is the meaning of the first parameter of this function.
Prithaa
|
|
|
|
|
To create a modal dialog box indirectly, first allocate a global block of memory and fill it with the dialog box template. Then call the empty CDialog constructor to construct the dialog-box object. Next, call InitModalIndirect to store your handle to the in-memory dialog-box template. The Windows dialog box is created and displayed later, when the DoModal member function is called.
|
|
|
|
|
Hello,
Thanks.
I have understood that a block of memory has to be allocated and a DLGTEMPLATE template to be filled.
But how do I fill up the template and how do I allocate block of memory.Is there a site where I can look up.
Prithaa
|
|
|
|
|
prithaa wrote: Can you tell me how to use InitModalIndirect() function of CDialog class?
And what exactly is the meaning of the first parameter of this function.
MFC has provided a class CDialogTemplate . include "afxpriv.h". Documentation for afxpriv says that contents of this file could be altered in the future, but for a demo I will show you how to do this. Look up source code for CDialogTemplate for more information...
Eg:
CDialogTemplate dlgTemplate;
dlgTemplate.Load( MAKEINTRESOURCE( IDD_SOME_DIALOG_ID ));
CDialog dlg;
VERIFY( dlg.InitModalIndirect( dlgTemplate.m_hTemplate, 0 ));
|
|
|
|
|
|
Hello,
When I used the InitModalIndirect(),the function was executed successfully since while debugging it returned 1 a non-zero .
But the dialog box was not displayed on screen even if I called the CDialog::DoModal() function after InitModalIndiect()
Thanks
Prithaa
|
|
|
|
|
Hello, I'm trying to draw a toolbar with icons designed by myself(which I'm very proud of them ). I use CImageList to store my icons then I pass my ImageList to CToolBar to do the rest of work. I did not use LoadToolBar because I wanted to have greater control over buttons and their associated pictures. How should I tell to CImageList to get its hand off my icon and do not place a black background behind them. I want background of my icons be color of my framework.
This is my code...
<br />
m_ImageList.SetBkColor(CLR_NONE);
m_ImageList.Add(LoadIcon(hIcon));<br />
...<br />
m_ToolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_TRANSPARENT, WS_CHILD |WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);<br />
m_ToolBar.GetToolBarCtrl().SetImageList(&m_ImageList);<br />
...<br />
thanks
|
|
|
|
|
You didn't show how you are creating the image list. It needs to be masked...
// assuming icons are 16x16
m_ImageList.Create(16, 16, ILC_COLOR24 | ILC_MASK, 0, 1);
...
m_ImageList.Add(LoadIcon(hIcon));
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|