|
hi,
MFC + MS Access using ADO sample code can be found at http://www.geocities.com/jcynion/jcynion_codes.htm, look for VideoRental sample code.
It load data to a listview, allows add,edit and delete.
Hope this will help
|
|
|
|
|
Hi,
I have an abstract base class Graph which has concrete child classes Grid and Puzzle. To keep the code general, I use pointers to the base class Graph and instantiate them to either Grid or Puzzle objects. This works fine until I have to delete any of these, where I get the "Debug Assertion Failed!", "_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" error. For example:
Grid *g = new Grid();
delete g;
works, but
Graph *g = new Grid();
delete g;
doesn't. Does anybody know why this is? Any help would be greatly appreciated.
|
|
|
|
|
Is the destructor for your base class virtual?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Is the destructor for your base class virtual?
That was it, thanks. Guess I just don't think of destructors and stuff for abstract classes since they don't get instantiated directly.
Well, live and learn.
|
|
|
|
|
I can't find any relation between the base class virtual/non virtual destructor and delete operator. Could you explain your message?
|
|
|
|
|
Graph *g = new Grid();
delete g;
It works fine for me.
|
|
|
|
|
I am new to C++ programing (6 mo). I have written numerous calculation programs where I use multiple 'struct'(nested) with multiple constructor and member functions plus a full set of functions. I have even created arrays of structs to compare designs. I have a menu function where I create input data files on the a: or d: drives and I write multiple output files for printing/viewing and for import into EXCEL. Unfortunately I revert to dos .bat files to manipulate between running the .exe, printing using the dos d:/ format and start Notepad for viewing. I manually import some files into EXCEL for further processing. Since I can't seem to see how to change the font size in the dos print command, sometimes the default doesn't suit my output. Any comments? Thanks.
Running in a separate application (CD from a QUE book - C++ by Example by Steve Donovan) he used Turtle Graphics to plot functions. I haven't yet solved this problem in my MS Visual C++ program. This is where I used EXCEL. Are there any #Include librarys available?? Thanks again!!
Barry
|
|
|
|
|
Hi, is there a registry entry, file to look for, or some way for my program to find out what (if any) version of the microsoft data objects is present on the computer?
Thanks!
|
|
|
|
|
Different ways are there:
check for the value of following registry key.
HKLM\Software\Microsoft\DataAccess\Version
or
check for the file version resource of msado15.dll
There is no spoon.
mail
|
|
|
|
|
Thanks
|
|
|
|
|
Hi,
I need to select any subitem from any item of a CListCtrl, report view (the best would be to distinguish between single-click and double-click, but that does not work when using GetFirstSelectedItemPosition).
1. If I know the clicking position:
I can localize the subitem with SubItemHitTest,
I can localize the item with GetFirstSelectedItemPosition and find the subitem using GetSubItemRect
2. I can catch the click on the control with NM_CLICK respectively NM_DBLCLK, BUT I DON'T RECEIVE THE CLICKING POSITION
How can I catch the clicks on the control with position?
|
|
|
|
|
Vancouver wrote:
How can I catch the clicks on the control with position?
Use GetMessagePos() to get the position the mouse was at when the message you're currently handling was posted. Use this inside your NM_CLICK/NM_DBLCLK handlers.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
I am having a problem when the resolution of the screen changes in my app. I made the app in a high resolution and the borders and the drawings i make in the app seems great in that resolution, but when i change the resolution to a smaller value and i execute the program every thing will out of order then i decided i have to scale down the dimension of every drawing depending on the resolution selected but i was wondering if there was a suitable factor (scale down or scale up ) factor taking one of the resolutions as a base for example if the scale factor in 640*480 is 1 then the scale factor @ 800*600 is 0.72 or smtn like that if so pls let me know
|
|
|
|
|
i also experienced the same problem, and some of the applications which i found , doing this fairly well..
i solved my problem temperorly like, i made two kind of GUIS, one for higher resolution and other for lower resolution,
but i heard that some of the activex's available in some site can shrink/grow our graphices elements as well as the controls according to the screen resolution..
i am also searching for a solution for this..i posted the same problem 2-3 times here..but no one answered me..!!!
programming in VB is like riding a kiddy bike, while programming in C++ is like driving a Formula 1 racing car
|
|
|
|
|
Hi
Get the clientrect using the GetClientRect and resize the controls @ the
onsize event(ie add resizing code). Hope this might help you
Sujan
|
|
|
|
|
Yes, because designing to 'the resolution' will always get you into trouble.
Resolutions and aspect ratios appear differently on different monitor types and the windows coordinate mapping can be different inside dialogs for diffeent fonts, or if 'use small fonts' is enabled. You need to dynamically size your items.
You can use GetCLientRect for interior drawing or GetWindowRect if you are drawing the entire window area.
|
|
|
|
|
OK, I'm writing an app (in win32 / plain c++) and I need to have several toolbars in the main window. These toolbars must be flat-style, and be a mixture of text and non-text buttons - in other words, I need to use toolbar features only present in common controls 5.81 and above (win2k+ and winME+)
Now, I'd also like to support Windows NT and Win9x as the rest of my application has no such limitations. So the problem I'm facing is, what do I do to get the toolbar functionality on these "lesser" platforms?
Option #1 is write my own toolbar UI code completely from scratch.
Option #2 is to make my app "fail gracefully" and use "normal" toolbars on the older O/Ss.
(yuck, I really hate the boiler-plate code required to get those horrendous toolbars up and running)
I've already done option#1, it wasn't too hard and I'm quite happy with the result. The problem is, although my app is now 100% backward compatible, it is no longer future compatible - i.e. when new features / themes are introduced, my application won't be able to take advantage of them unless I rewrite the toolbar code.
So what would you do in my situation? Deploy custom, bespoke non-standard toolbars that behave *exactly* as I want them to, or suffer the limitations of the *cough* cruddy *cough* standard windows toolbars?
James
http://www.catch22.net
|
|
|
|
|
Maybe you can wrap your class so that, when available, it delegates on the common control. Best of both worlds.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I would say Option 2. I love consistancy. If you are running NT4 and you install a new app you would expect that the GUI elements would be consistant with other apps. You dont want one app that has a custom coded toolbar to look like toolbars in Win2k and another app where they have made the toolbar look like a Mac program and other apps that have the standard NT4 type toolbar.
|
|
|
|
|
Hello group,
I was wondering if you guys can help me out to understand how to create a link list holding a copy of a structure and a link list holing a pointer to a struture.
Any clue?
Thanks in advance
Jim
Thanks
|
|
|
|
|
Are you rolling your own data structure or are you using the one in the STL? If the latter, I think it's as simple as:
struct mystruct<br />
{<br />
int num;<br />
char val;<br />
};<br />
<br />
list<mystruct, mystruct> mylist;<br />
list<mystruct*, mystruct*> myptrlist;
I don't use the STL, so this might be a tad off.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks David,
There was a forgotten point. It should be:
mystruct mylist;
right? or I'm missing somehing. Since the code doesn't point to the structure itself. But my point was how can I put pointers to a structure into a link list instead of its copy.
Thanks
Thanks
|
|
|
|
|
Jim Smith1 wrote:
There was a forgotten point. It should be:
mystruct mylist;
right?
I'm not sure what you mean by this.
To add to the first list, use:
list<mystruct, mystruct> mylist;
mystruct ms;
mylist.insert(ms); To add to the second list, use:
list<mystruct*, mystruct*> myptrlist;
mystruct *pmystruct = new mystruct;
myptrlist.insert(pmystruct);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Ok, first thanks for your help. Honestly, I'm kind of confused.
I'm assuming the first one makes a copy of a structure into the link list
and the second works to copy a pointer to the sturucture into the list.
Correct?
let me know please.
Thanks for reading my aticle
|
|
|
|