|
mr_mark_hewitt wrote:
First, I want to use display a clock in my applicatio that uses an atomic clock to sync its time with. What is the recommended way to do this/links to useful info?
Modern versions of Windows (XP, 2003) come preconfigured to contact time.windows.com using the Simple Network Time Protocol[^]. If you join a machine to a 2000 or 2003 Active Directory domain, the machine then gets its time from the domain controller.
Second, I also need to display the time of other timezones, say I'm in LA, and want to diplay the time for London and NY. Does any body have links to information on how one would go about determing the time in other timezones,area.
My World Clock[^] sample application does this. Source code is available at that link - it's a C# application but uses OS function calls for the actual time conversions. The tricky bit is handling daylight savings time - otherwise it would be a simple offset calculation.
My biggest issue is with how the user can pick his location and how the software knows the timezone/etc at that location?
You'd have to have some kind of database of locations and the corresponding time zones.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Wow, cool, many thanks for the link, great article!
The API function should do the trick just fine, I'll scan the net a bit to see if I can come up with an implementation someone did for 9x, otherwise this feature just won't be supported on those OS'es
Many thanks again!
|
|
|
|
|
mr_mark_hewitt wrote:
First, I want to use display a clock in my applicatio that uses an atomic clock to sync its time with. What is the recommended way to do this/links to useful info?
You can use RFC-1035, RFC-867, or RFC-868 for this. I've found examples of each to be plentiful via Google.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Dear All,
I am vc++ newbie. I need to create virtual directory in IIS 5.0/6.0 from vc++ 6 application I have this sample. http://www.installsite.org/pages/en/isp_net.htm[^] It is gives lots of errors when i comple it in VC++ 6.0. Can any one send me a sample code to create Virtual ditectory in IIS 5.0/6.0 from vc++ 6 application.
Thanks in Advance
|
|
|
|
|
You probably need an updated Platform SDK. Download it from Microsoft SDK Update[^]. Tell the installer to register with VC++ 6 if requested.
If that doesn't help try defining _WIN32_WINNT to 0x0500 before including any headers (e.g. at the start of your stdafx.h).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
How can I change the background color in of dialog form if the values for red,green and blue are entered through three text boxs which are placed on the first dialog forms.The resultant color RGB color is displayed on the second dialog form.
Can anyone please help me in this matter
Hopping for a early reply from any one .
PHILIP
|
|
|
|
|
In the second dialog form create a brush
CBrush m_brBk;
m_brBk.CreateSolidBrush(RGB( r,g,b ) );
OverRide OnEraseBackground
CRect rc;
GetClientRect(&rc);
hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
Hi, everyone:
I have a problem about how to open a document file with a specific application or pass some parameters into the application while opening the document file.
For example:
I need to open a .nrv file, a Nero file. But using ShellExecute() would always open Nero in traditional mode. I wanna open the .nrv file by Nero Express. I examine the shortcut of the Nero Express is like this:
"C:\Program Files\Ahead\Nero\nero.exe" /w
It looks like passing a parameter into the nero.exe, how can I do that through programming? Thanks!
|
|
|
|
|
In ShellExecute
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
<code>LPCTSTR lpParameters, </code>
LPCTSTR lpDirectory,
INT nShowCmd
);
pass \W in lpParameters
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
But that would only execute Nero Express but not open the .nrv file if lpFile is passed with the path of nero.exe and lpParameters is passed with /w . On the other hand, if lpFile is passed with the path of the .nrv file, the parameter /w is ignored since it views .nrv file as a document file, as MSDN said. Actually it didn't work...
But thanks for your reply anyway...
My code is like this:
// csFilePath is a CString object which is equal to the path of the nero.exe
// or the path of the .nrv file.
ShellExecute(GetSafeHwnd(), NULL, csFilePath, "/w", NULL, SW_SHOWNORMAL);
|
|
|
|
|
I didn't check but what will happen if you attch your parameters right to the filename?
|
|
|
|
|
ytod wrote:
ShellExecute(GetSafeHwnd(), NULL, csFilePath, "/w", NULL, SW_SHOWNORMAL);
Use it this way
CString str;
str.Format("/w %s",<code>lpFileNameToOpen</code>)
then
ShellExecute(GetSafeHwnd(), NULL, csFilePath,<code>str</code>, NULL, SW_SHOWNORMAL);</
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi! I downloaded the source code for the simple MP3 player from this site. I am trying to add volume buttons in MFC. I added the buttons and functions with the class wizard in Visual C++ 6.0, but my functions are not working. Here is my code:
void CAVIPlayerDlg::OnVolumeDown()
{
long vol;
vol = MCIWndGetVolume(m_Video);
vol-=250;
MCIWndSetVolume(m_Video,vol);
}
void CAVIPlayerDlg::OnVolumeUp()
{
long vol;
vol = MCIWndGetVolume(m_Video);
vol+=250;
MCIWndSetVolume(m_Video,vol);
}
It runs, but the call MCIWndGetVolume(m_Video) returns 0 each time, and the volume isn't affected. Any ideas?
|
|
|
|
|
You may need to check if m_Video is a valid MCIWnd handle...
If so, use this function to check the error code: MCIWndGetError( ).
Good luck!
|
|
|
|
|
Hello,
I'd like to loop over a std::list and for a given element in the list, get a pointer to that element. My code looks something like this:
<br />
Object* pointerToObject;<br />
iteratorType listStart, listEnd, listIt;<br />
list<Object> objectList = getObjectList(); <br />
listStart = objectList.begin();<br />
listEnd = objectList.end();<br />
for(listIt = listStart; listIt != listEnd; listIt++)<br />
{<br />
pointerToObject = listIt;
}<br />
<br />
Any ideas?
Thanks!
-Jordan Atlas
|
|
|
|
|
pointerToObject = &(*listIt);
I think that should work. What I usually do is have the list store the pointers instead of the objects themselves. The list makes a copy of everything it stores so storing pointers means it only has to copy 4 bytes for each object while storing the object themselves means the list copies the entire object.
list<* object> objectList;
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
pointerToObject = &(*listIt);
Hey PJ,
This code works! Thanks!
I usually store pointers in the lists as well, but for some reason I didn't in this case. I'll have to look at the code to see why I implemented it that way.
Merci,
-Jordan Atlas
|
|
|
|
|
I have hexadecimal value of unicode character. How to add it to standard char string?
|
|
|
|
|
You can't, by definition. A unicode character is multibyte, a char string contains one byte per character.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
first Convert Them to Standard Char using wctomb and then add the resulting charater to regular char String
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
The following code
BOOL CMainFrame::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID = pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
if(nID)
{
// pTTT->lpszText = MAKEINTRESOURCE(nID);
// pTTT->hinst = AfxGetResourceHandle();
// return(TRUE);
}
}
else
{
strcpy(pTTT->szText,"Ruby Red GSC-XXX\nRuby Red");
pTTT->lpszText = NULL;
pTTT->hinst = NULL;
return TRUE;
}
return(FALSE);
}
Gets executed when I have my cursor over one of my items in the toolbar but the tooltip does not get displayed at the toolbar button or on the status bar of the app. Why ?
I figured it out, I needed to add:
pTTT->lpszText = pTTT->szText;
then the tip displayed by the button but not the status bar of the app.
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
In your CMainFrame class there is a variable as
CStatusBar m_wndStatusBar;
Now to set the text on your status bar use
m_wndStatusBar.GetStatusBarCtrl().SetText("Your Text",0,0);
Rahim Rattani
Software Engineer,
Matrix Systems (Pvt) Ltd.,
Karachi - Pakistan
|
|
|
|
|
What i want to be able to do is send text from one client to its server. I need a client which is done by tcp. I've seen some of the chat rooms programs but as I'm all new to this its too over my head. I need a simple program. Please help us out
|
|
|
|
|
Try to read some MSDN documents about Windows Sockets API or MFC class CSocket or CAsyncSocket. You should understand the the mechanism of TCP first. If you wanna use a simple way to realize your program, use MFC CSocket would be your choice. But Windows Sockets API would be better for developer. Good luck.
|
|
|
|