|
I am a beginner at C++ but hope to get quite good and go into software development. I am trying to make a clock in c++. I use Dev-C++. Does anyone have a tutorial for clock in Dev-C++, everthing i found on here is for MS Visual C++.
Thanks in advance.. it is really appreciated!
~Adam
|
|
|
|
|
Is your clock SDL, OpenGL, DirectX/Direct3D, analog/digital, etc? Dev-C++ is WxWidgets library for the UI, but otherwise utilizes other open graphics libraries that are available for any compiler.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
VC 2005 Express Edition does not support MFC, however, it IS a very good standards compliant compiler, it's free, and you'll find tons more help for it.
I recommend buying a beginner book on C++ ( core C++, the standard language, not MFC or any other library ), working through it, trying to complete your task yourself, and asking specific questions when you get stuck. A tutorial will TELL you how to write your program, that's not the way to learn.
Good luck, I did the same thing about 7 years ago, and while I no longer use C++, I have succeeded in making a career out of my hobby.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am confused how to get mutex locks to work correctly. As part of my testing I wrote the following code:
HANDLE hMutex = CreateMutex(NULL, FALSE, "ABC");
int result = WaitForSingleObject(hMutex, INFINITE);
int result2 = WaitForSingleObject(hMutex, INFINITE);
The first line creates a mutex, then the next line "locks" the mutex, then the next line waits for and tries to relock the mutex. It seems to me that the second Wait should never return (since the Mutex is already locked.) However, both Waits return immediately with the return code 0 (== WAIT_OBJECT_0).
What am I missing?
|
|
|
|
|
Your first line creates a mutex and your current thread owns it. Your current thread will continue owning it until you call ReleaseMutex(). In your second thread, WaitForSingleObject() will wait until the first thread calls RealeaseMutex(), after the first thread has released it, the second thread will own it. If the first thread wants to own it again, it must wait until the second thread releases it. understand?
It doesn't work in your example because it's all in the same thread.
|
|
|
|
|
Yes, I get it, I tried in a separate thread and it works as expected. Thanks for your help.
|
|
|
|
|
|
I'm unable to find a simple api call to get the current display settings of a particular monitor? Is there an easy way to do this or do I have to enumerate them?
|
|
|
|
|
|
Thanks for the link. Using GetDeviceCaps still involves enumerating the monitors to get a hold of the DC, or get a hold of the device name to create an IC with.
I realised there was no simple way to do what I wanted, so I put a class together to enumerate the displays and get the info through EnumDisplaySettings. The only trouble I'm having is getting ahold of a HMONITOR. I can get it from a HWND, POINT and even a RECT, but not from a device ordinal :/
|
|
|
|
|
Does anybody know of a good direct3D programing forum? I suggested CP create one about a month ago but it has yet to happen, and I have noticed that not many of the C++ forum users have an in depth knowledge of Direct3D. So I'm hoping maybe one or two of the users here have a programing site or two stored in their favourites that they know to tailor for D3D developers.
|
|
|
|
|
|
Hi,
I created a MFC AppWizard dll(MFC Extension dll) with a single function which i have defined in Export section of .def file. The function has only 2 parameters:HWND and CString. I'm calling the dll from an application. The function executes well and gives the expected result. But when i come out of the function, I'm getting exception:
"The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling
convention".
I tired giving _MSWIN_ and _WIN32 in C/C++ tab. But it is not working. The dll uses CxImage downloaded from codeproject.
What could be the problem?
Thanks & Regards,
Sanju.
|
|
|
|
|
It is because the part that call your function doesn't have the same calling convention as the one of your function. You are probably calling the function from a VB program right ?
To solve the issue, simply add a __stdcall before your function.
void __stdcall MyFunction();
See here[^]
|
|
|
|
|
Hi ,
Thank you. It worked.
The calling application also was MFC appln.
Thanks & Regards,
sanju.
|
|
|
|
|
i have put listview in my one child window when i click on the listitem it will open new window(showwindow).
but the window i got is not updated why ?
how can i update ?
please refer the follwoing code.
well i have put the UpdateWindow(hwndTagEditorDlg); but its not working what should i do?
1)
LRESULT CALLBACK GlobaListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
.
.
.
.
case WM_NOTIFY:
{
.
.
.
.
if(((LPNMHDR)lParam)->code == NM_CLICK)
{
iSelect=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
if(iSelect==-1)
{
break;
}
index=iSelect;
ShowWindow(hWndinoutfiledir,SW_HIDE);
ShowWindow(hwndEncrypt,SW_HIDE);
//Hide File Split window.
ShowWindow(hwndSplit,SW_HIDE);
//Hide encoder window.
ShowWindow(hwndUpload,SW_HIDE);
ShowWindow(hwndTagEditorDlg ,SW_SHOW);<br />
UpdateWindow(hwndTagEditorDlg);
}
}
//on the click of the item the new widnow proc is here it should display all the empty control but it didn't
LRESULT CALLBACK TagEditorProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
Utility util;
switch(message)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_SAVE_TAG:
_ResideId3TagForSelectedFile(hDlg);
MessageBox(hDlg,_T("You file has been saved"),_T("encoder"),0);
break;
}
break;
}
return FALSE;
}
void _ResideId3TagForSelectedFile(HWND hDlg)
{
//std::vector multiset <string,string,string,string,string,string,string,string,string,string> TAG3 t; //it is now class
//TagEditor _ProtectSet[MAX_PATH]; //it's made global
static int i=0;
Utility util;
TCHAR buff[MAX_PATH];
ListView_GetItemText(hList,index,0,(LPWSTR)&buff,MAX_PATH);
std::wstring buff_input(buff);
std::string compare(buff_input.begin(),buff_input.end());
WCHAR w_Artist[MAX_PATH],w_Title[MAX_PATH],w_Album[MAX_PATH],w_Year[MAX_PATH],w_Copyright[MAX_PATH],w_Author[MAX_PATH];
WCHAR w_Gener[MAX_PATH],w_Desc[MAX_PATH];
string str_Artist,str_Title,str_Album,str_Year,str_Copyright,str_Authour,str_Gener,str_Desc;
GetDlgItemText(hDlg,IDC_EDIT_ARTIST,w_Artist,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_TITLE,w_Title,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_ALBUM,w_Album,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_YEAR,w_Year,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_COPYRIGHT,w_Copyright,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_AUTHOR,w_Author,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_GENRE,w_Gener,MAX_PATH);
GetDlgItemText(hDlg,IDC_EDIT_DESCRIPTION,w_Desc,MAX_PATH);
str_Artist=util.ConvertWCHARToString(w_Artist);
str_Title=util.ConvertWCHARToString(w_Title);
str_Album=util.ConvertWCHARToString(w_Album);
str_Year=util.ConvertWCHARToString(w_Year);
str_Copyright=util.ConvertWCHARToString(w_Copyright);
str_Authour=util.ConvertWCHARToString(w_Author);
str_Gener=util.ConvertWCHARToString(w_Gener);
str_Desc=util.ConvertWCHARToString(w_Desc);
//this will stored values in the object _ProtectSet[i++].Exchangedata(index,compare,str_Artist,str_Title,str_Year,str_Album,str_Copyright,str_Authour,str_Gener,str_Desc);
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
2)i would like to ask you the second thing i read the xml file in which it will display
all the tags(bascially xml values related with Edittextbox) when user click on the listitem.
where should i intialize the object of that class first time when application load and put the data which i have fetch from the XML file.
so when user click on the old file which already display in the listview which is also fecth from xml file. it will also show the tags as respectively.
if nessary i will Ready to justify the xml file
|
|
|
|
|
I am currently working on a Pioneer Robot, and I would like ton install a gps receiver on it. I want to work with the Holux GPS receiver (211 series), which is an USB one. But I am not a programmer and I absolutely don't know how to communicate with it. I work under Linux and i would like to initialize the receiver, communicate with it and gather data from it (position, speed, etc). Maybe could one of you help me with my problem, giving me a C++ code that I could use, or a website link on which I could find what I am looking for.
I thank you in advance (and please excuse my english, but I am French ).
A. G.
|
|
|
|
|
If you go to the manufacturer website and download the manual:
http://www.holux-uk.com/Products/gr-211/download.shtml[^]
you will see that you need to install a USB driver (also available on manufacturer website).
The USB driver creates a virtual COM port.
The unit sends NMEA strings to the virtual COM port.
There are a lot of examples out there on reading data from a COM port.
This is Windows programming website and, although many here can/do write code for unix based systems, you won't find any linux specific examples here.
There are a number of GPS examples here though that you could use to help parse the NMEA strings.
Do a search here for "GPS NMEA".
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi
All
I have developed project in VC++ 6.0 but now i want to migrate it to VC++.Net so what are steps i needed to follow to run project in VC++ .Net.
Regards
Atool
Atool
|
|
|
|
|
When you want to open a old project on the vs2005 it says do you want to get backup and also you can see steps convert and a reposrt of convert
|
|
|
|
|
You want to convert it to the managed version? or convert it to 7.1, 8.0 unmanaged compiler version?
Dario: How is "directory" in French? (I mean a file system directory).
John Simmons: "zee file holdaire thingie"
|
|
|
|
|
1. Load the .dsw file in VC7 or 8 (whichever you have)
2. Build
3. Fix any compiler errors - you'll likely have some since the compilers in 7 and 8 have much better standard compliance.
|
|
|
|
|
Hi i Have written a project in mfc/c++ in vc.net 2005 compiler but cannot make setup for it. As far as i know we have Install shield in vc6 to make the mfc setup but can't find such in vc.net .
I will be grateful to be answered
|
|
|
|
|
|
Hi,
How i can get cooridinates and size of area on IE window where IE display html pages ?
I was try IWebBrowser2->getTop,getLeft,getWidht,getHeight but it's returns values for entire IE window.
How i can get same but only for area (MSHTML ??) where IE render and show web page ?
Thanx for help !
|
|
|
|
|