|
Hello,
I am building a simple program with VC ++ 6
I am using a dialog box to calculate the time it takes to finish a race in ideal time. (type in distance, input speed constant and click CALC then time should apear).
I am having a bit of trouble however converting the base 10 calculated time to real time. I get 1.5 instead if 1 hour 30 minutes. I was wondering if there are routings in VC that do this. Using integers it woul dnto be too bad I could mod 60 everything but I am dealing with floating point numbers and that is why I am stuck.
If you could help I would be greatly appreciated here
Thank you
|
|
|
|
|
Can anyone suggest me a tool to create AVI files for use with CAnimateCtrl, preferably one that allows to create 16 color AVIs?
|
|
|
|
|
Hi,
Can any expert tell me that how can I display the elapsing time once i have started the timer. It's should be something like a swatch watch. I need to know how to code the elapsing timer and to display it on the screen. I have done some coding that starts the timer and stops the timer, but that is in increment order, i need a decrement order timer function. I use the Pc system timer to implement the timer class. In my class i have included the folowing functions:
StartTimer()
EndTimer()
GetDuration()
Thank you for your help.
|
|
|
|
|
In what context.
Be a bit more specific.
Do you:
a. Need drawing code for the watch (swatch)
b. Or just need to know when the timer has elapsed.
Regards
Norm
|
|
|
|
|
I would like to know if there's a way to add checkbox in a CListCtrl view for each column
|
|
|
|
|
I am in the process of developing a custom desktop for Windows NT. In my implementation of this custom desktop, there is a window along the bottom of the screen that emulates the behavior of the Windows NT Taskbar.
This taskbar implementation sets a WH_SHELL hook and a WH_CALLWNDPROC hook to receive notifications concerning window creation, title changes, etc.
During the early portions of development, this custom shell was always ran on top of Explorer.exe. Eventually the custom shell was moved to a test system whose policy file (ntconfig.pol) directs windows to run the custom shell at boot time rather than Explorer.exe.
I have noticed that when this is the case, I no longer receive callbacks from the WH_SHELL hook procedure, although I still receive callbacks from the WH_CALLWNDPROC hook procedure.
I can launch Explorer.exe from the custom shell and I begin to receive callbacks from the WH_SHELL hook. I can even end the Explorer.exe task from the taskmanager, and I still receive shell hooks. It seems that Explorer.exe must at least run once before I receive any callback from the WH_SHELL hook.
I have discovered no information anywhere on MSDN that indicates that this is the case.
Does anyone have any information as to why an application would not receive WH_SHELL hook procedure callbacks unless Explorer.exe has been started at least once on a system?
|
|
|
|
|
When you do receive WH_SHELL callback, what process is the hook DLL in ?
|
|
|
|
|
Where can I find a decent corba IDL compiler for ms vc++ 6 ?
I found a couple of sites on the net but with all of them you need to install tons of junk before it works .... and then it still gives problems !!
|
|
|
|
|
I am wondering how those guys coded file/directory hiding in the "Magic Folders" program at the system level.
Is that some kind of file system driver ?
Any ideas?
|
|
|
|
|
You might check out the docs for the CreateFile api call. Don't let the name fool you, this call also opens objects for reading.
The Shell API also knows all about the special flavored folders. There is a good tutorial on the shell here at codeproject.
Jim
|
|
|
|
|
I use a CWebBrowser2 control to display reports details from my program. I generate the HTML, and display it in the CWebBrowser2 window. I'd like to also display graphs in this window. If I bought the Dundas Chart ActiveX control, does anyone out there know if I could insert it into my CWebBrowser2 control? I can't use the Server Side edition of Dundas Chart as I the computers my app is running on can quite possibly be totally stand-alone.
Thanks for any help at all.
|
|
|
|
|
Hi
Well I'm close to insanity so it's time to ask you, the gurus
I've made a DLL in Visual C++ and can successfully call it from within Visual Basic. However, I can't pass function arguments. For instance, one of my functions is:
SetWindowPosition(LONG handle, float width, float height)
Which is declared in VB as:
SetWindowPosition(ByVal handle As Long, ByVal width As Single, ByVal height As Single)
Strangely the last argument is passed correctly, the rest take on erroneous values such as 9.72*e-39. Why would one argument (eg. height) be passed correctly but width is garbage? Guessing it had something to do with the stack, and misaligned arguments (ie 8 byte long reading 4 byte int), I've tried a simple function with just one argument (Single->float as per VB4DLL.txt) but even this produces garbage. With the above function I've also tried converting from Long to long, unsigned int, int, etc. Any ideas?
Regards
Brendan
(For the record I have done the following:
1/ Using a DEF file
EXPORTS
SetWindowPosition //note I don't have @1 is that a problem?
2/ Using extern "C" __declspec(dllexport) before function
3/ no __stdcall statements but it still runs...
|
|
|
|
|
Well like most problems the solution is simple. I'll post it here to ease the agony on others who might have to trawl through mountains of messages.
In VB a function that returns a variable is declared as 'Function' and a function that doesn't return a variable is declared as 'Sub'. So the correct declaration is
Public Declare Sub DoSomething Lib "DLL.dll" (ByVal dooba As Long)
for a function that doesn't return a value. and,
Public Declare Function DoSomething Lib "DLL.dll" (ByVal dooba As Long)
for a function that does return a value.
Obviously it stuffs the stack up if you don't do it right, and this is what produced the erroneous values.
|
|
|
|
|
Sorry for not being as clear on my last post =(
Is there a way to give focus to your program even when you don't control the program that DOES have focus?
|
|
|
|
|
The function you want is SetForegroundWindow() , although in 98/ME/2K there are restrictions on when you can actually make your app come to the foreground. The docs have all the details.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
This doesn't seem to work in any of my tests and I can't find out why in the documentation.
Thanks,
Ed
|
|
|
|
|
Hi Ed,
Michael is correct, however you might have to have a thread in the bakground
which decides when and if this needs to be done.
{
while(WaitForSingleObject(..., 5000)!=Signaled)
{
HWND h = FindWindow(...);
SetForegroundWindow(h);
}
}
I hope I understood your question.
Jules
|
|
|
|
|
I'm using this code to create a dialog box:
CEdmondDlg *dlg;
dlg = new CEdmondDlg;
dlg->Create(IDD_EDMOND_DIALOG);
this creates the dialog but it doesn't have focus. How can I fix this?
|
|
|
|
|
dlg->SetFocus();
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
This doesn't work.. I think maybe because my whole program doesn't have focus when it is called. Is there a way to give focus to your program even when you don't control the program that DOES have focus?
|
|
|
|
|
Then probably your whole program should grab the focus in a similar wayt first. Why doesn't it have the focus, is it a background task ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
How to get handle of an edit control of another different running application?
|
|
|
|
|
How to get handle of an edit control of another running application?
|
|
|
|
|
I don't think that's possible. Search the MSDN on-line library for the keyword "handles". There's an article that
touches on that subject. The problem is that, even if you could get the handle, you probably couldn't do anything
with it because the object is in the address space of the other process. A handle to an object in process A cannot
normally be successfully referenced in process B because the object may, or may not, be the same object.
|
|
|
|
|
When assigning a CString to a BSTR, does CString contain a copy of the BSTR or is it a pointer to the same BSTR?
If I later destroy the original BSTR does this make the CString unusable?
Example: CString strAnotherCopy;
BSTR b;
b = SysAllocStringByteLen("Hello World", 12);
strAnotherCopy = b;
SysFreeString(b);
At this point, is strAnotherCopy still valid?
|
|
|
|