|
Agreed
|
|
|
|
|
Hi,
suppose there are to struct type,
struct small
{
float x;
double y;
};
struct large
{
int x;
float y;
double z;
bool w;
};
and in my program I coding as this:
large b;
small *p =(small) b;
what's going on inside the code operation?
Thank you.
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
NicholasCougar wrote:
small *p =(small) b;
This won't even compile. You are attempting to assign small to small*,( via unsafe casting).
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
how do you add libs to a project in msvc? do you add the file itself to the project or include the name of said lib in the list of included libs in the project settings.
|
|
|
|
|
You can do it either way, but I prefer to do it in the project settings.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Sometimes (always) I'm lazy...
so I add libs via include file, here an snip from my OpenGL project:
<br />
#pragma comment(lib, "OpenGL32.lib") //link with OpenGL32 Library (VC6 Sytnax)<br />
#pragma comment(lib, "Glu32.lib") //link with Glu32 Library<br />
Hoep it helps, Moak
|
|
|
|
|
I'm learning to use DialogBoxes in "C", via LCC-win32 compiler. My question is about managing virtual-keys. I can manage them while dialogues don't have controls (via WM_KEYDOWN message) but otherwise can not capture these virtual-keys. I guess this is about focusing on child-windows(buttons, checkboxes etc). But why? How?... In fact I can manage them if I use "ACCELERATOR" but want to learn that if is there a solution to do this without accelerator tables. I can not give a meaning to this. Isn't this WM_KEYDOWN message sending before a control? For instance, I have an aboutbox which has two buttons(OK-CANCEL), how can I capture VK_END virtual-key?(again; without accelerator tables). Thanks from now on whose interested in.
|
|
|
|
|
Maybe you could try handeling the pretranslate message and trap it there. Not sure, just a guess.
Paul S
|
|
|
|
|
In dialog boxes, handling accelerator keys require a slight tweak. I have explained this in the following article :-
http://www.codeproject.com/useritems/pretransdialog01.asp
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Hi,
Thanks Nish. Thanks for your advance. In fact I'm very weak in C++, nevertheless I will try your article
|
|
|
|
|
Anyone have some info on that? I'd very much like to learn something about it. The new Winamp 3 has it, anyone know anything about it?
Thankyou
|
|
|
|
|
I don't remember the names of the functions you use to make transparent windows, but search in the articles, I know there's a couple about this subject...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
They are supported only in W2000 and XP AFAIK. So to write an app that uses them you need to late bind to the function and detect the OS before callng them. I've done it, LMK if you can't find an article that covers this stuff and I'll knock one up for you.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
You should be able to find a couple of articles in MSDN and the APIs if you do a search on Layered Windows .
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Actually it's not that hard, you just use the SetLayeredWindowAttributes function.
|
|
|
|
|
WHen i try to compile my program, the compiler says that WS_EX_LAYERED and LWA_ALPHA an undeclared identifier. in the msdn library it says to include the windows.h file, and i have already included that...
|
|
|
|
|
You need a later platform SDK in order for these to be defined.
If you don't want to bother downloading it, slap this on your source file:
#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
#endif
--------
Higher education helps your earning capacity. Ask any college professor. --Shog9 --
|
|
|
|
|
|
I am trying to implement a document/view application. I got the program to compile but it stalls when the line 'AddDocTemplate(pDocTemp);' is executed. I keep getting the 'Debug Assertion Failed' box. Below is a snippet of the InitInstance code. Thx
BOOL CApp::InitInstance(void) {
//register class and document
CSingleDocTemplate *pDocTemp;
pDocTemp = new CSingleDocTemplate(IDR_APP,//UINT nIDResource
RUNTIME_CLASS(CAppDoc),//CRuntimeClass* pDocClass
RUNTIME_CLASS(CMain),//CRuntimeClass* pFrameClass
RUNTIME_CLASS(CAppView));//CRuntimeClass* pViewClass
AddDocTemplate(pDocTemp);// !!!Problem here
//parse command line info
CCommandLineInfo cmd;
ParseCommandLine(cmd);
//dispatch command line info
if (!ProcessShellCommand(cmd))
return FALSE;
//show/update window
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
ralf.riedel@usm.edu
|
|
|
|
|
Which line of which module gives the ASSERT?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi,
Does anyone know of a good FREE platform independant source
code control system that works with Visual C++?
I tried installing cygwin and its port of CVS
but Visual C++ projects seem to have a problem
co-existing with it.
Thanks
|
|
|
|
|
I haven't used it myself but you might want to give WinCVS a try.
Good luck!
Andy Metcalfe - Sonardyne International Ltd
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++
"I would be careful in separating your wierdness, a good quirky weirdness, from the disturbed wierdness of people who take pleasure from PVC sheep with fruit repositories."
- Paul Watson
|
|
|
|
|
Folks,
When I replace the background HBRUSH on a Window:
1) Am I expected to delete the OLD HBRUSH?
2) Expected to delete my NEW HBRUSH?
Or both?
Mike.
|
|
|
|
|
Restore the old one when done. Then, you can call DeleteObject() on both.
Jeremy L. Falcon
"You do not know the power of the dumb side."
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
Hi,
I have a listbox which I automatically scroll down when I add new new lines (for a chat). Unfortunately, I want to avoid this autoscroll behaviour when the user decided to scroll up and look for older text. Because otherwise each new incoming text would anoyingly scroll to the end again.
Hmmm, my idea was to look on GetScrollPos() and do not autoscroll when the position is != the ending position. Is this a good idea, any other ideas?
Thx for help.
|
|
|
|