|
The time style effect is very good
|
|
|
|
|
hai gud afternoon everyone,
i created a window form using c#.net & ado.net with sqlserver database.
in my form i use a combobox that contains customerid,connected to the database.if i want to add new customerid to the combobox at dynamically,for that purpose i can use a button,if we can click a button click that opens a new form with new customer details,enter the customer details and submit the database,that customerid column is also in main form database.my problem is if i enter new customer id at run time that id could not display in hte combobox at run time .i can use refresh method to referesh the form, the form should be refresh but the enter id did not display in the combobox.how can i overcome my problem,plz populate a solution to my problem.
thanks in advance.
|
|
|
|
|
though my source code of the digital clock has been compiled properly but there are many errors when i am trying to build it.
How can i get the real code for visual studio 6++. Pls anybody help me.
|
|
|
|
|
I try to use the html file to publish this activeX, but it work fine in the http://localhost/test.htm. But failed in the http://127.0.0.1/test.htm what's wrong with it?
Here is test.htm's file:
<title>ActiveX Sample
<object
id="CimCtrl"
="" classid="clsid:C0F8D526-E412-11D5-9724-0048545319BF
CODEBASE=" http:="" 127.0.0.1="" dtimer.ocx#version="1,0,0,1"
" width="263
" height="142
">
thanks
-- modified at 4:07 Thursday 16th February, 2006
|
|
|
|
|
Im new to programing and it says the afxctl.h is missing
with fatal error C1083: Cannot open include file: 'afxctl.h': No such file or directory
Where could i find the appropriate files?
|
|
|
|
|
whether or not,has the demo source file.
e-mail:davidge@townsky.com
|
|
|
|
|
Dear,
It is a greate control. However, I have a question. When I try your activex control in "ActiveX Control Test Container". It works fine and it can refresh itself every one second.
However, when I insert the activex control to "Words" or "Excel" and run it, the control only refresh when I click on it. It doesn't refresh automatically. I don't know what wrong with that. Do you know the problem ?
Best regards,
Hing
PS: To try it in excel, follow the below:
Open Excel -> Show the "Control ToolBox" -> Click on the "hammer" icon in the bottom right corner in the ToolBox -> Choose the "DTTimer Control" in the popup list -> Create the control using mouse -> Click the "ruler" icon in the top left corner in the ToolBox to exit Design Mode.
Now, the controls is running. However, it doesn't refresh unless you click on it.
|
|
|
|
|
well, you can look into the code in DTimerCtl.cpp line 252,
void CDTimerCtrl::OnTimer(UINT nIDEvent)
{
if(this_mode==0) InvalidateRect(NULL);
COleControl::OnTimer(nIDEvent);
}
i thinked because the default mode is 0, so the ocx doesn't update itself.
After i commented it , the control can refresh correctly.
lchjxsh
|
|
|
|
|
Hey there, I'm having a bit of trouble with some code of mine that seems to be occuring with the timer (well, for me anyway). When I drop the timer into a project (VB) and run it, the timer only refreshes the screen if it looses foucs and then gains it again. I was just wondering if anyone else has had problems like this as it's driving me up the wall with a streaming webcam component I'm writing. It streams, but only if you hide the window then show it again. Repeatedly. The timer event is working, but i've and i've tried things like InvalidateRect, InvalidateControl, RedrawWindow ... but no function that I can find will actually redraw the window. Any Ideas?
Cheers
Oliver Sneyd
|
|
|
|
|
I have used the control in VC++(6.0 and 7.0) projects fine. I have also test it on html pages, and there were no problems. I don't know anything about VB , but maybe you're doing something wrong. Perhaps try another activeX control on your form and see if it works...
If you're using .NET, Shripad Kulkarni converted my code to .NET. Check http://www.c-sharpcorner.com/Code/2002/July/WCLDigitalClock.asp.
Good Luck !
|
|
|
|
|
I really have no idea whats going on with my project. I've mapped the on timer event, and my timer is firing, the screen just refuses to update. I have been compiling it in debug mode, and have tried release mode, but to no avail. I have the same problem with the timer. If you can see anything in this code, please let me know
CPressCameraCtrl::CPressCameraCtrl()
{
InitializeIIDs(&IID_DPressCamera,&IID_DPressCameraEvents);
m_lReadyState = READYSTATE_LOADING;
//Initialize VisSDK properties
ImageFile = "output.bmp";
ImageSource = VisFindImageSource("");
//Connect to the webcam, if one has been found
if(ImageSource.IsValid())
{
//Connect to the webcam
Sequence.ConnectToSource(ImageSource, true,false);
}
}
void CPressCameraCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
//Start a timer that redraws the screen every 20 microseconds
static int i = 0;
if(i == 0)
{
i = 1;
SetTimer(1, 1000, NULL);
}
...
}
//Handles the timer from the function
void CPressCameraCtrl::OnTimer(UINT nIDEvent)
{
//Redraw the application to get the new image
InvalidateRect(NULL);
COleControl::OnTimer(nIDEvent);
}
|
|
|
|
|
Ah... Forget I said anything. It was stupid VB all along. I put the control you made into a VC project and it worked no worries. Of course I found this out after I deleted my own project in frustration. Ah well, such is programming
|
|
|
|
|
First I think you're doing all wrong....
CPressCameraCtrl - what class is this ? 'Cause if this is the control class you don't have to overwrite the OnDraw method.
There are three simple steps:
1. Place the ActiveX control on a form (Insert ActiveX control......);
2. Associate a member variable with the control. let's say m_camera.
3. In the InitDialog function of your dialog class, call m_camera.SetMode(1)
4. In the same function, start a timer with the period you want.
5. Create the OnTimer function in your dialog class.
6. In that function, call m_camera.SetTime(v1, v2, v3);
v1, v2, v3 are three members of the dialog class (int) which can represent whatever you want: hours, minutes, seconds, milisonds.... theese variables are initialized in the constructor of the dialog class.
In the OnTimer function, you increase theese variables. Hope that works for you.
|
|
|
|
|
First I think you're doing all wrong....
CPressCameraCtrl - what class is this ? 'Cause if this is the control class you don't have to overwrite the OnDraw method.
There are six simple steps:
1. Place the ActiveX control on a form (Insert ActiveX control......);
2. Associate a member variable with the control. let's say m_camera.
3. In the InitDialog function of your dialog class, call m_camera.SetMode(1)
4. In the same function, start a timer with the period you want.
5. Create the OnTimer function in your dialog class.
6. In that function, call m_camera.SetTime(v1, v2, v3);
v1, v2, v3 are three members of the dialog class (int) which can represent whatever you want: hours, minutes, seconds, milisonds.... theese variables are initialized in the constructor of the dialog class.
In the OnTimer function, you increase theese variables. Hope that works for you.
|
|
|
|
|
When I work with "MFC app wizard", I can use an activeX by choose an dialog -> right click -> insert activeX control...,
and I choose a controls from list (Ex: Window media player).
Could you tell me how can I add this control in that list?
|
|
|
|
|
You have to register the control first:
Command line -> "regsvr32 dtimer.ocx"
If the registration is successfull, you can see the control in the list
|
|
|
|
|
Thanks a lot!
[IMG]http://sinhvienufa.vietnam-it.com/forums/html/avatars/dethuong/Avatar7A1F.gif[/IMG]
|
|
|
|
|
Hello,
I have compiled an ocx activex. I tested it on localhost but I want to publish it. There is no attribute on my html page indicating the location of my activex. How will the browser of a distant client know where to get the activex from? How do I publish an activex?
Thanks in advance,
Balteo
|
|
|
|
|
try Internet Component Download. in short, you have to pack up the control(ocx) as a cab file and let the user download and install it thru ICD.
|
|
|
|
|
First of all, you need to create a .cab file that contains your .ocx and one .osd file.
The .osd file contains informations on how to install the component to the client computer. You can do that with MS Visual Interdev 6.0 or MS Visual Studio .NET. The .osd file is created automatically and packed along with the control.
From the .html file:
<object id="OBJECT_ID" style="LEFT: 0px; TOP: 0px" codebase="archive.cab#version=5,0,0,0" align="baseline" border="1" classid="clsid:60B86FFD-5095-4A02-8D39-6C64B90C3D50" viewastext="">
If the archive.cab file is in a directory on the server different from the .html file, specify it.
When the user opens this page, the .cab file is downloaded, and installed.
However, there is another matter of security. By default, in MS Internet Explorer security settings, the unsigned ActiveX controls will not be downloaded, so yopu have to modify this settings from the Internet Options. Or, maybe you want to sign your control (that's pretty expensive).
Another troubble is if you're using MFC. You can't be sure is on the client has mfc*.dll installed, so you have to compile your control with the option: Use MFC in a static library, otherwise, the control will not be registered on the client.
Good Luck !
|
|
|
|
|
I'm having trouble starting the timer. You say "you must start a timer in which you update the time by calling the SetTime member function" How is this done exactly? I'm not a very experienced programmer. Could you show me some code on how this is done?
Thanks
|
|
|
|
|
If anyone is still working on this, I just thought you may want to know, I have the same problem. Its not starting on the up timer. Perhaps I need to make a call to some initialization function? Maybe this applies for any ActiveX controls in any C++ MFC application?
Thanks in advance if you have any information on this problem.
|
|
|
|
|
As you can see in the sample, you must start a timer on your application using SetTimer(...). You handle the timer with the OnTimer() event. In the OnTimer function, you must call the control's SetTimer member function, to update the displayed time.
This is shown in the sample.
|
|
|
|
|
This thing has some incredible flicker -- You should take some time and see if you can fix that using memory dc's or by not erasing everytime you draw -- something is screwy....
|
|
|
|
|
I hve designed this timer to be used as a clock (h:m:s). If you use it as a timer with milseconds, the flicker is really enoying. I will revise that.
Thank You.
|
|
|
|
|