|
Pleas help! I know nothing about Databases
I have an MFC Dialog app that connects to a Access database. I found some great code here www.codeproject.com/database/readdb.asp and this works fine but it only shows how to read from a database. I need to send data to the database from my dialog app as well as read. If anyone knows how to do this using the same structure as in this demo I would be really really grateful!
Thanks,
Alan
|
|
|
|
|
How about this article?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello all,
does anyone have any experience with MS Flex Grid?
I want a simple, MS based, lightweight grid control that allows me to:
- display tabular data
- sort (numerical, dates, string)
- dispaly boolean values (checkbox)
- edit the data
- Show cell focus selection
There is a lot of great information on how to customize the standard MS
list control, but was wondering if MS Flex Grid can be used instead.
If someone knows about a good documentation, please let me know.
thanks
|
|
|
|
|
With the exception of the checkbox, MSFlexGrid will do all of those things. It might even do the checkbox, I've never tried it.
Hope this helps,
Bill
|
|
|
|
|
Maybe a simple question for the most of you...
How can I force to open a menu in a menubar without using the mouse?
I´ve tried this...
RECT rect;
int nCnt = 0;
::GetMenuItemRect(hWnd,hMenu,nCnt,&rect);
::SendMessage(hWnd,
WM_LBUTTONDOWN,
(WPARAM)MK_LBUTTON,
MAKELPARAM(LOWORD(rect.left),HIWORD(rect.top)));
This should open the very first menu in the menubar (typically "File" menu), but it doesn´t work...
Any ideas?
Amar
|
|
|
|
|
You should look up the TrackPopupMenu API call.
Regards
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Hi,
How to calculate the date and time in different timezones? How to convert a specific Standard Time to localtime in different timezones? With localtime API we will be able to do that for current timezone settings. But if we want to find out the localtime for different timezones (e.g. EST, Pasific, Mountain etc..), is there a way to achieve that?
Amar
|
|
|
|
|
Get this from MSDN:
if( _putenv( "TZ=EST5EDT" ) == -1 )
{
printf( "Unable to set TZ\n" );
exit( 1 );
}
else
{
_tzset();
printf( "_daylight = %d\n", _daylight );
printf( "_timezone = %ld\n", _timezone );
printf( "_tzname[0] = %s\n", _tzname[0] );
}
|
|
|
|
|
I am very puzzled by this one. Previously, when one wanted to have a custom enum in the typelib, he simply put it in the library section of the idl file:
library SomeLib
{
typedef enum { someval } MyEnum;
}
and voila.
But with VC.NET, and attributed C++, how do you do that??? I tried the following:
[module .....];
[export, public]
typedef enum { someval } MyEnum;
but the declaration is not part of the typelib, since it is before the library statement in the generated idl file.
Anyone have tried this before? Is it still possible to do it? Do I have to switch back to non-attributed C++???
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi all,
I wish to malloc a large char array (to handle appr. 1 MB file sizes), how can I do that without cracking my computer wide open?
/Tommy
|
|
|
|
|
If you absolutely need to have a contiguous block of memory of 1MB, go ahead and request to malloc a block that big. Chances are there'll be no serious problems, as 1MB is handlable by PCs these days, and moreover the virtual paging mechanism will help liven things up.
Apart from this, maybe you can get by with some block of memory that grows on demand, so that only gets to these huge sizes when actually required. If so, have a look at std::vector , which automates this behavior for you.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquin is right!
Better allocate the memory as you need it:
with malloc and realloc I normally use! So you don't have to allocate on 1MB up front!
Al
|
|
|
|
|
Malloc will work just fine with one warning.
The only problem I have ever run into with allocating large blocks of memory is that if you allocate/free that block a lot, you run the risk of fragmenting your virtual address space. This can happen if you free that 1MB block and then part of it is used by a smaller allocation. Then when you go and try to allocate 1MB again, the system has to allocate a new 1MB block.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Have you considered memory mapping the file? Not only is this faster than reading the file into a buffer, but it will be read into memory on demand (as you access the different parts of the file).
Chris
|
|
|
|
|
Nope, haven't... How do I do that?
/T
|
|
|
|
|
CodeProject may have some examples, I am not sure. Look through the help for the function MapViewOfFile(). Richter also talks about memory mapping in depth in his book advanced windows programming.
Chris
|
|
|
|
|
In the VC6 IDE it was simply Alt-Enter, Down arrow to HTML. I haven't been able to figure out yet how to ask the VC7 MDE to color .shtml files. (It does .html automatically)
- Jason
(SonorkID 100.611)
"The sort of guy who'd give the kid an extra scoop of ice cream free if he was an ice-cream man"
- Nish, on Chris Maunder
|
|
|
|
|
|
The Dragon Book is a good place to start.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Look for information on reverse polish notation.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
In BNF statement, there is a symbol can express "empty" meaning.
But I don't know how to express "empty" meaning in YACC decription file?
I'm amumu, and you?
|
|
|
|
|
I'd say it is more or less like this:
emptyrule :
; but I could be totally wrong
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I am pretty new to VC++, I mainly use it to create small dialog-based apps using the Windows API. However, at the moment I am trying to create a progress bar using the CProgressCtrl with a window created using CreateWindowEX() (I don't want to use the normal CreateWindow...PROGRESS_CLASS method for the bar as I want to use an extended class that can create a progress bar with gradient colours). This sounds stupid, but I am completely stumped on how to create a progress bar this way. My problem seems to lie with the difference between CWnd and HWND. The parent window that I want to use for the control is not a dialog, but has been created using CreateWindowEx(), and I can't find any examples on the net of how to do this properly (all the examples I can find relate to dialog-based apps). This is the code I am trying to use:
CProgressCtrl MyProgressBar;
CWnd *parentwindow = CWnd::FromHandlePermanent(hwnd);
//hwnd = windows window created using CreateWindowEx()...
MyProgressBar.Create(WS_VISIBLE|WS_CHILD|PBS_SMOOTH,CRect(10,10,200,30),parentwindow,1);
This is all in WinMain(). Everything compiles okay, but when I run the executable I get an assertion error (line 19 of afxwin1.inl, or some such) and of course, there is no sign of the progress bar.
If anyone could tell me what I am doing wrong (and I know it's something really stupid owing to the fact that I'm a novice programmer), I would be very grateful.
Many thanks,
Keith
|
|
|
|
|
This is all in WinMain()
I guess this is where the problem lies. If you're dong raw Win32 apps (which provide of a WinMain ) you've got no MFC support. CProgressCtrl is an MFC class, so it's on wonder nothing works. Create a new project and select the "MFC app" type (or something like that.) The way of writing programs changes from what you're used to, but it doesn't take long to get a passing idea of how it works.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, thanks for your reply. I've got my program set up so that it's using "MFC in a shared DLL", and there I no errors when I compile. Is it the case that you can't use MFC and WinAPI together? Sorry for the dumb question, but I've never used MFC before. If that's the case I guess I'll have to get learning MFC, unless there is some way of using a gradient coloured control bar in WinAPI (it's the only feature I need to add to my program...).
Again, thanks for your help.
Cheers,
Keith
|
|
|
|