|
But let say this function is called every cycle
Are we still talking about bmpLoader function? Do you suggest that you'll be loading bitmaps from disk in tight, time-critical loop?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have made a DLL. I have used it from SDI program. I want to send a message from dll through SendMessage() to view of SDI.
I have written the message handler as well. I have registered the message on both dll as well as application (that is SDI)
Luck favors the prepared mind.... [Under Siege 2]
Regards Naveed.
|
|
|
|
|
I have created a help file external to vc++, but i can not figure out how to run it.
I have created a message map
ON_COMMAND(ID_HELP,OnHelp)
I have created a OnHelp function
What do i need to put in the OnHelp function to startup the help file?
Or am I looking at this from the wrong direction
thank you ?
|
|
|
|
|
From MSDN:
WinHelp
Starts Microsoft® Windows® Help (Winhelp.exe) and passes additional data that indicates the nature of the help requested by the application.
BOOL WinHelp(
HWND hWndMain,
LPCTSTR lpszHelp,
UINT uCommand,
DWORD dwData
);
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
In a class,I want to put the method's address to a DWORD value.
How to do it? or can I access the vtable of the class?
hi
|
|
|
|
|
You can't do that in a portable way. Why do you need this functionality?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want use assembly to call method.
now I got the way to do it.thank you!
hi
|
|
|
|
|
class foo
{
public:
void func ( int x ) {}
};
DWORD dw = (DWORD) foo::func;
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
DWORD dw = (DWORD) foo::func;
Sorry - this will not compile, at least on VC6 (error C2440).
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I am resizing a CTabctrl in response to a WM_size. Basically I want the Tab Control to fill the entire window at all times.
My Code is as follows
CRect size;
GetClientRect(&size);
int iWndWidth = size.right;
int iWndHeight = size.bottom;
::SetWindowPos(m_tabs,0,0,0,iWndWidth-15,iWndHeight-15,SWP_NOMOVE | SWP_NOZORDER);
Can anyone tell me why i needed to subtract 15. By the way It's a CFormview i am working with.
Thanks In Advance
Rich
|
|
|
|
|
|
That's what he's asking, too. Read the question again.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
OK - I will re-phrase my question. What happens when you don't subtract 15?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
use
void CFormViewEx::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if (m_pTabCtrl.m_hWnd != NULL)
m_pTabCtrl.MoveWindow(0, 0, cx, cy);
}
Then you don't have to subtract 15
|
|
|
|
|
That piece of code with the 'movewindow' does the job well. Cheers
When i didn't subtract 15, the Tab Control was not drawn in the top left and was therefore too big for the screen. Still curious why that happened, anyone know why?
|
|
|
|
|
I have several problems with my code you can see here
.
.
.
void CProjectSoftwareDlg::OnStart()
{
if(WinExec("iexplore -k index.html",SW_SHOWNOACTIVATE)>31)
{
OnOK();
}
else
{
MessageBox("Damn...");
}
}
.
.
.
.
1. Problem: The ie doesn't even run. I always get "damn" back...
2. Problem: I am not able to set index.html to "index.html" because of those "'s
3. Problem: I have to get a local pathfile into the IE is this possible or do i have to get the filesystem.
At all i get no warning or error back while compiling.
I hope you are able to help me
sleater
|
|
|
|
|
Use ShellExecute() instead of WinExec()
Like
ShellExecute(handle, "open", "http://www.codeproject.com/", NULL, NULL, SW_SHOWNORMAL);
if you want to open a webpage, or
ShellExecute(handle, "open", file:///c:\test.htm, NULL, NULL, SW_SHOWNORMAL);
to open a local file...
And yes, there are 3 "/" in file:///, it's not a typo
Hope it helps...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
thanks a lot
sleater
|
|
|
|
|
But there's still a problem two "//"'s are interpretet as an comment...
sleater
|
|
|
|
|
They should be fine as long as they're within the double quotes.
Regards,
Alvaro
|
|
|
|
|
Exactly, I just forgot the double quotes.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Can somebody tell me how I can convert centimeters into pixels?
e.g. I have given the value 25cm (centimeters, an european, or at least german unit of measurement ) and want to know the value in pixels.
I nee to draw some object very accurate onto the screen.
Any code is greatly appreciated
regards
|
|
|
|
|
I'm sorry to inform you that an answer will only be possible if every monitor in the world is the same size and runs the same resolution. You can find out the resolution from Windows, I know of no way to find out the size of the monitor with accuracy, let alone the fact that you can control from the front panel how much of the screen is used.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
You probably didn't unerstand my question
I.e I just found out that 100 pixel are equal to 3,571 centimeters.
Now I need to convert Pixels into Centimeters an vice versa.
How can I do this using c++?
|
|
|
|
|
What Chris was trying to make clear was that 100 pixels may equal 3.571 centimeters on your monitor, but on mine it could be 4.672 cm (just an example). How is c++ supposed to know the size of your monitor? And even if it knew it was a 17'' monitor, how is it supposed to know how big the screen's display area has been set to by means of the buttons on the front of the monitor?
There are som DC functions you can use to get an *estimate*. Set your mapping mode to one of the fixed-size ones (MM_TWIPS, MM_LOENGLISH, MM_HIENGLISH etc) an use the LPToDP and DPToLP functions. But there's no satisfaction guarantee!
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|