|
NASM[^]
Free, and the best assembler!
Maxwell Chen
|
|
|
|
|
Hello,
I've got a dialog application generated with the Visual Studio 6 class wizard. After generating the app, I added an acellerator table.
I loaded the table like this
::LoadAcelerators(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MAINFRAME));
I tried loading it at several places, in the InitInstance() and the main dialog constructor for exemple.
I don't know why, but my shortcut keys don't seem to work .
Did someone experience the same problem, or does anyone know an answer to this %$&^%N problem? Thanks in advance.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Bob Stanneveld wrote:
::LoadAcelerators
is this api valid, could not find it in the MSDN.
give this method a try
LoadAccelTable(...)
it needs to be loaded in the framewindow.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Hi
Mr.Prakash wrote:
::LoadAcelerators
is this api valid, could not find it in the MSDN.
Whoops, I guess I made a typo. It should be
LoadAccelerators()
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
To handle accelerator keys, you need to do two things. Firstly, you need to load the table; secondly, you need to handle them.
LoadAccelerators returns a handle to the loaded table. If it returns NULL , the table couldn't be loaded. Typically this means that a resource of the appropriate type with this resource identifier couldn't be found in the module instance passed to the function. You'll need to store this handle somewhere so we can use it in stage 2.
Stage 2 requires us to hook into MFC's Windows message handling. MFC offers the PreTranslateMessage function, which we can override to do what we need to.
You can find sample code in July 2000's MSDN Magazine[^] (the third question down).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks very much, that PreTranselateMessage() function did the trick for me.
Mike Dimmick wrote:
(the third question down)
It was the 2nd question
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
when scroll the horizontal scrollbar,i want make the first column fixed.
thanks!
|
|
|
|
|
hi
No luck.
Otherwise you can do by subclassing the list control and by overriding OnHScroll . We need 2 skip the base class scrolling and to impliment our own scrolling logic using GetScrollPos and SetScrollPos. But it is hardly time consuming and err prone. Then we have 2 take care of all the columnmovement, header movement everything. But I prefer u keep those content in the first column outside ListCtrl - in the parent window.
rgds..mil10.
|
|
|
|
|
|
can someone show a simple example of the best and most effective way to forcefully close a prog?
|
|
|
|
|
hi
Call TerminateProcess to terminate a process. This needs the process handle as input. Call OpenProcess to get the process handle. This needs processId as input. Call Process32First and Process32Next to loop thru the running process and to get the ProcessId. Call CreateToolhelp32Snapshot before calling Process32First .
sample code is available on msdn.
rgds..mil10
|
|
|
|
|
Hello.
I am a C++ programmer with limited experience (design) using C#. From my experience, C#, like Java, is a derivative of C++. However, Microsoft is able to blend C# and C++, getting the best out of the Java design.
With the recent settlement between MS and SUN, I think that MS will remain the top desktop software company. Bottomline: C# should surpass Java given that it is in fact platform-independent.
I have some basic questions on the C# language.
Currently, does a C# application run on a non-Win32/Win64 platform (UNIX, Mac, wireless)?
How does C# compare to C++ in terms of object-oriental design (inheritance, template, etc) on a large-scale project?
How does C# compare to C++ for client/server applications including various IPC concepts, multithreading, multiple processes, etc?
How does C# compare to C++ for processor-intensive applications including games, 3D-render, multimedia, etc?
I read some reviews on two books on C# by Jeff Prosise and Charles Petzold. In general, readers find the books GUI-oriented. How good is C# for performance-imperative applications?
Thanks,
Kuphryn
|
|
|
|
|
kuphryn wrote:
Currently, does a C# application run on a non-Win32/Win64 platform (UNIX, Mac, wireless)?
Sort of. Have a look at the Mono project - they have a C# compiler and so forth
kuphryn wrote:
How does C# compare to C++ in terms of object-oriental design (inheritance, template, etc) on a large-scale project?
Probably similarly to Java.
kuphryn wrote:
How does C# compare to C++ for client/server applications including various IPC concepts, multithreading, multiple processes, etc?
Pass. .NET certainly makes those things a lot easier and less error prone. Have a look at .NET Remoting and Asynchronous Delegates for starters.
kuphryn wrote:
How does C# compare to C++ for processor-intensive applications including games, 3D-render, multimedia, etc?
Well, if you're working on the bleeding edge, C++ will probably let you squeeze out a few percent extra performance at the cost of much more complicated development. Later versions of DirectX have support for using a managed language like C#.
kuphryn wrote:
I read some reviews on two books on C# by Jeff Prosise and Charles Petzold. In general, readers find the books GUI-oriented. How good is C# for performance-imperative applications?
I would say that C# is quite suitable, but if you're learning, keep a close eye on the code you are writing and the objects you are creating. It's quite easy to screw up your performance if you create a lot of objects and the GC can't collect them in a good time for some reason, so all your app does is swap all the time.
HTH
Ian Darling
"The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt." - Bertrand Russell
|
|
|
|
|
|
I'll also emphasise the plaform independance of C# - not so good at the moment, and unlikely to support the full .net framework anytime soon. Java definatley has platform independance and if you are considering a Unix/Windows co-development then it, and C++ (with judicious use of libraries), are your only options.
|
|
|
|
|
I often read about fully OO feature in languages including Java and C#.
How important is object-oriented paradigm?
Nonetheless, the good things seem to point to platform-independence rather than the OO paradigm.
How would you evaluate fully OO paradigm (C#, Java, etc) to a flexible programming language like C++ that gives the developer unsurpassed control without going to ASM?
Kuphryn
|
|
|
|
|
I want to know how to determine how much of the video RAM is in use. For example, you have 8 MB of video RAM available, and your graphics intensive program is running. How much RAM is left, before you make that next SaveDC call and get an error or something.
In the MSDN, I have located some IOCTL calls to the video mini port driver that you can use to get video memory status, but I am not sure how you to contact the video miniport driver at the application level.. If someone knows how to do that, any help appreciated.
Thanks.
|
|
|
|
|
Are you sure that this uses Video Ram at all? I read MSDN SaveDC()[^] it says the following The SaveDC function saves the current state of the specified device context (DC) by copying data describing selected objects and graphic modes (such as the bitmap, brush, palette, font, pen, region, drawing mode, and mapping mode) to a context stack. and it makes no mention of video memory at all.
John
|
|
|
|
|
Thanks for your reply. No, I am not sure.
Since I can locate code to track almost everything except available video RAM, I wanted to be complete, and that was just one of my suspect functions potentially leaking memory or GDI handles or 'somethihng' out there that is causing other GDI calls to fail.
I did find this useful link for tracking GDI objects:
Detect and Plug GDI Leaks in Your Code with Two Powerful Tools for Windows XP
http://msdn.microsoft.com/msdnmag/issues/03/01/GDILeaks/default.aspx
|
|
|
|
|
Blake Miller wrote:
determine how much of the video RAM
One way to do so is create a directdraw7 interface and use IDirectDraw7::GetCaps to get the amount of free video memory.
John
|
|
|
|
|
Hello
i've got a char **reser, and i pass it to a function like this:
<br />
char **reser;<br />
ParsearReservadas(ArchReser,reser,&cant,vec);<br />
the function header is:
<br />
void ParsearReservadas(FILE *FileReser, char **reser,int *cantpalres, int *vec)<br />
i write something to the char ** inside the function (after using malloc), and i print it and it's ok, but when i return to main i print it and i can't see it.
this piece of code works inside the function but doesn't work in main
<br />
for (i=0;i<=(cant);i++)<br />
printf ("%s\n",reser[i]);<br />
what's the problem ?
thanks!
|
|
|
|
|
kfaday wrote:
i write something to the char ** inside the function, and i print it and it's ok, but when i return to main i print it and i can't see it.
That's how function parameters work. To make the change visible to the caller, make the parameter a reference:
void ParsearReservadas(FILE* FileReser, char**& reser, ... );
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Windows troubleshooting: Reboot first, ask questions later.
|
|
|
|
|
|
How can i save BMP files as frams to AVI file?
i can get Frames from AVI and i Put them into BMP files
how can i add bMp to AVI?
|
|
|
|
|
Someone may have answered this already, but I could not find one. So a pointer to an already answered article. Or an answer would be appreciated.
I have downloaded a couple of the ComboBox examples and they work as advertised when I use the demos provided. However, when I incorporate the code into my own project it does not perform the same way. Specifically When I run the demos the ComboBox will drop down with a complete list of selections. When I click on the ComboBox in my project (6.0) I can't get the complete list. I get a single drop Item. So can anyone tell me how I can make the Visual C++ 6.0 project provide a complete drop down list with all items showing? I.E. When you click on the ComboBox Drop button how do I get all items to show instead of just a single item?
Many thanks for any help.
Charlie
|
|
|
|
|