|
It could be code which accesses the machine code of the function fun at runtime. What was the contents of the structure?
Steve
|
|
|
|
|
The struct is just as following:
Struct Node {
int x;
Struct *Node;
}
|
|
|
|
|
|
|
Not digestible with my Visual C++ 2003.
error C2440: 'type cast' : cannot convert from 'int (*)(long)' to 'A *'
Maxwell Chen
|
|
|
|
|
Hi all,
I have an array of pixeles:
UINT * ptPixels;
I want to send the values in this array using CSocket.
Then use StretchDIBits API.
How can I do that?(Converting values correctly)
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Correct. socket remotely
Kuphryn
|
|
|
|
|
What does it mean?
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
hi to all
1.what is purpose of a member function
that is in the protected in the class defenion
what his abilities ,and what is the difrence if it is in the public ?
2.what is the difrence between protected and privete ?
thanks in advance :->
mayer
|
|
|
|
|
|
im developing an application where i have to use the volume down and up keys. but i cant handle these keys in my code. I mean i want to change their defautl action. Im using NO MFC c++.
Can somebody help me with this?
thnks a lot
Galvanoski
|
|
|
|
|
Not sure about Win CE (I'm guessing PPC means pocket PC) but in regular Win32 you can handle the WM_APPCOMMAND message. The OS sends that to the active app when the user presses one of the additional keyboard keys or mouse buttons.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi Mike, thanks but WM_APPCOMMAND is not supported by pocket Pc
Galvanoski
|
|
|
|
|
This is supposed to simulate a pay telephone
It's not working right for me.
Won't add the time and money.
Any help would be greatly appreciated.
Thanks
#include <stdio.h>
#include <ctype.h>
main ()
{
int coin, total = 0, time=0;
int type;
do
{
printf("\nPlease enter a coin\n(10,20,50)\n[0 to quit]:\n");
scanf("%d",&coin);
if (coin == 10||coin == 20 || coin == 50);
total = total + coin;
} while(coin!=0);
display_time(int total,char type);
printf("\nPlease enter the type of call you wish to make,\n 'L' for local,\n 'T' for trunk,\n 'I' for international:\n");
fflush(stdin);
scanf("%c",&type);
type = toupper;
{
if( type == 'L')
time = (total/10)*30;
if (type == 'T')
time=(total/10)*15;
if (type == 'I')
time=(total/10)*5;
}
printf("Total credits allowed : % d\n\n", total);
printf("You have %d seconds of call time\n\n",time);
main();
{
int total;
char type;
total = getcoin();
type = gettype();
display_time(total,type);
}
}
|
|
|
|
|
Door Mat wrote: It's not working right for me.
Which is fairly meaningless without describing the problem.
Door Mat wrote: int type;
Change this to:
char type; Door Mat wrote: type = toupper;
Change this to:
type = toupper(type); Door Mat wrote: main();
What in the world are you doing here?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Major Thanks Mate.
The program should first request the user to enter coins.
Vaild coins are 10c,20c and 50c. All other values should be ignored.
The program should continue to request coins until 0 is entered.
The program should then request a call type from the user.
Valid call types are L(local), T(trunk),I(international).
The progam should continue to request a valid call type until one is enter.
LOCAL CALLS 30 seconds for 10 cent
TRUNK CALLS 15 seconds for 10 cent
INTERNATIONAL CALLS 5 seconds for 10 cent.
When a valid call type is enter, the program should calculate and display the amount of time the user has to make.
|
|
|
|
|
But what is the problem you are seeing?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
I basically have
foo.h
#include "bar.h"
bar.h
#include "foo.h"
and it results in fatal error C1014: too many include files : depth = 1024.
So I tried doing '#pragma once' in each file, no luck. I then tried doing
#idndef UNIQUE_IDENTIFIER
#define UNIQUE_IDENTIFIER
// all header code
#endif
That didn't work so I tried using the pragma once statement & the above with no luck.
When I say the previous solutions 'didn't work' I mean that objects from foo.h could not be recognized by methods that required them in bar.h, the compiler didn't know what they were.
Ideas?
Thanks!
|
|
|
|
|
chasetoys wrote: ...objects from foo.h could not be recognized...in bar.h
You might need to use either a pointer or a forward declaration.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Could you please elaborate? I'm kind of a newbie
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
I don't know if my comments will help, or add anything to DavidCrow's reference, but here it is anyway.
In my include files I am able to control their contents. I don't know if you can define the contents of "foo.h" and "bar.h", but if you can try the following:
foo.h
struct Foo_Struct {
// Bar_Struct* bar; // wrong, Bar_Struct is not known yet
struct Bar_Struct* bar; // correct, compiler knows Bar_Struct is a struct
};
bar.h
struct Bar_Struct {
// Foo_Struct* foo; // wrong, Foo_Struct is not known yet
struct Foo_Struct* foo; // correct, compiler knows Foo_Struct is a struct
};
This will work as long as the type is known but it is not used. If you tried "struct Bar_Struct bar" instead of "struct Bar_Struct* bar" it would not work unless struct Bar_Struct is fully known at the time ("bar.h" would have to be included first). You can have one of the files declare one of the structs (by correctly selecting the inclusion order), but there is no easy way to have both if none of them is a pointer. The same applies to classes, obviously.
Rilhas
|
|
|
|
|
Hi, I have a dialog application that I would like to have on top of another application at all times.
I have tried using CWnd::SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE), but that will keep my app on top of all windows, not just the single application I'm aiming for.
It looks as though I will need to get the pointer to the CWnd for the other app and use that as the first arg to SetWindowPos() to get the results I want.
So far, I have retrieved the process ID for the other application, but I don't know how to retrieve the CWnd * given that ID.
Is there a better approach than using CWnd::SetWindowPos()?
I am using vc++ 6.0.
Any help is appreciated.
Thanks!
|
|
|
|
|
pince wrote: So far, I have retrieved the process ID for the other application, but I don't know how to retrieve the CWnd * given that ID.
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Thanks for the reply. I included the code from the link you gave me and tried to create a CMainWindowIterator. However, the compiler complains b/c it doesn't recognize the EnumProcesses and EnumProcessModules functions from his code. MSDN lists these other the "psapi.h" header, so I tried including <psapi> and <psapi.h>, but the compiler for 6.0 didn't recognize these either. These appear to be .NET dlls? How can I use this for 6.0?
Thanks.
-- modified at 15:02 Thursday 27th April, 2006
|
|
|
|