|
I have a C++ class as a part of a COM object which is as follows :
typedef struct {
int currentSize;
int currentIndex;
int requestedAddress;
short requestedType;
string requestFunction;
UINT8 *buffer ;
} AomMemoryParameters;
I add a type of this struct as a private member .
AomMemoryParameters currentParams;
Now in a private function
when I try to do
currentParams.currentIndex=0;
currentParams.currentSize=0;
I get a runtime error . I am unable to figure out what the error is
|
|
|
|
|
Post the IDL code for the structure.
Kuphryn
|
|
|
|
|
I have a program that accesses a PCI card and reads data in memory on the card.
I am trying to convert the program so that the data that is in memory on the card can be displayed in various textfields and other widgets.
Should I do this with the MFC WIZZARD APP or should I choose another type of project?
Is there any project that allows me to choose from a list of widgets and place them where I want them?
My Boss wants me to use Borland and I have been using it, but the driver for the card is written in VC++. I'm sure as you know the 2 don't work well together.
If I can come up with a good solution using VC++ then I won't have to mess with Borland again.
Thanks for the help,
sj
|
|
|
|
|
a) Your expectations for MFC are a bit high. You'd be better of with C#, or Borland C++ if you know it already.
If "driver" means the OS driver, it really doesn't matter which language it's written in. You might need to do some adjustments to the code that does access the device, but basically, it should port reasonably between Borland and VC.
You can create a dialog based MFC application (using the MFC app wizard), which probably gets closest to your expectations. However, as much as MS touted it, MFC is no real RAD tool, and you're up for some serious learning.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Sounds like you are familuar with VC++ and Borland. I know borland fairly well and already have the GUI layed out. And the *.lib file converted to BC++B format. I just can't seem to get it to connect with the card. That is where I assume it has to do with the dll file that links to the card.
Would using the WTL be eaisier creating a widget type GUI?
At least with VC++ I have code project for some help.
I can't seem to find a decent Borland Builder forum anywhere. I have been using their news group but it takes about 24 hours to get a reply.
Does anyone know of a good Borland Builder forum?
All of your help is greatly appreciated.
sj
|
|
|
|
|
I don't have much experience with the late borland, However, I have *lots* of frustrating experience with MFC, and I know that a tool you know is always easier than one you don't.
WTL could be easier if you're used to raw Win32 programming, because WTL is fairly transparent (compared to the often smoke and mirrors MFC). However, WTL is far from RAD either (I assume you don't have much Windows experience beyond OWL just because you want to "place widgets". Placing them is easy, wiring them is not)
Try to get some documentation on the DLL. Might just be some declarations / function import stuff.
Your Borland does 32bit windows, right? (The last borland I touched was Win16...)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
You are right, I don't have too much experience with windows. I would much rather place wigets than wire them in.
I am going to keep pounding at this connection problem until it's figured out.
I was looking for a way out of the problem. I guess by other ways than figureing it out.
Maybe I'll eat a bananna.
I appreciate the help.
cheers,
sj
|
|
|
|
|
johnstonsk wrote:
Maybe I'll eat a bananna.
You're welcome.
Neither Windows nor MFC are "complicated voodoo magic", however, I'm always wary if someone thinks that an unknown tool will magically solve the problems with known tools...
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
John,
Probably the best bet is to use the MFC Appwizard in VC++. You can create dialogs and apps by widgets (controls) where you want them and write the code to handle them. Then just port your code across.
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Hi,
I want to add a tree view to my Frame window.
First I want to create a class that inherit from CTreeView,
So I write:
<br />
class CMyClass : public CTreeView<br />
{<br />
bla bla bla<br />
}<br />
I did it Using the Insert->New Class and so on, using the visual studio.
When I compile, I get an error that the base class (CTreeCtrl) is not recognized.......... How come ?
I have included stdafx.h in my application....
Shay
|
|
|
|
|
make sure
#include <afxcmn.h> is in your stdafx.h, and add
#include <afxcview.h> to it
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Coooooooooollllllllllll !!!
It works !
Thanks.
BTW,
My application is dialog based, when I created a window based I did not have this problem, what is the reason ?
|
|
|
|
|
Hello all,
My project consists of about 50 files and on top of each file i declared:
#pragma warning(disable : 4786)
but I still get these long compiler warnings (17!).
Any ideas why?
|
|
|
|
|
Might be caused by an stdafx.h include - if you're using precompiled headers, basically everything above #include "stdafx.h" is ignored silently.
add the warning(disable) to the stdafx.h, before you include any "offending" headers.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
ammm, I'm not sure I know what stdafx.h is. My guess is it has to do with MFC, however there is no useage of MFC in the project.
Thanks.
|
|
|
|
|
stdafx.h has nothing to do with MFC, it's the standard header file used for precompiled header support in VC (most project wizards create one automatically, and set up the project accordingly).
Look in your Files tab if a stdafx.h is part of your project. If so, put the #pragma above the first #include.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Are you being affected by:
For warning numbers greater than 4699, those associated with code generation, the warning pragma has effect only when placed outside function definitions. The pragma is ignored if it specifies a number greater than 4699 and is used inside a function.
If not, then MSDN article Q167355 is most likely the problem.
|
|
|
|
|
My mistake:
I put the pragma declaration after the include directives. Putting it before anything else made the trick.
Thanks for your help.
|
|
|
|
|
MSDN says you can have a CView or a CWnd as a pane in CSplitterWnd. CView is sorted but how do I create using a CWnd? There seems no equivalent to the CSplitterWnd::CreateView for CWnds.
cheers!!
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
|
|
Did you find the correct article? Just noticed I gave you the wriong link initially...
http://www.cherea.de/bitbucket/multisplitwnd/multisplitwnd.html
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi,
Is there a way to prevent dialog from closing when pressing on "enter" keyboard button?
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
If you are using MFC, see this FAQ:
http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_dlgclosekeys
|
|
|
|
|