|
|
Hie,
i just downloaded VC 2005 express.I opened an old VC 6 project that was written in the C language.When i tried building this in VC 2005 EXPRESS.. it gives me a whole Plethora of errors .Is the C language no more supported by VC express.Also i installed Microsoft Visual Studio .NET 2003.here VC supports the c language BUT does'nt support XP style.Where as VC 2005 express has a really good XP look .. i mean even the menus have a blue gradient on them.My problem is i NEED TO HAVE A VERSION THAT SUPPORTS XP STYLE AND THE C PROGRAMMING LANGUAGE.i only know C.Also i would really appreciate it if someone pointed me to a good
e-book on using VC with C++ NO MFC! .. i gonna start C++ soon!;P
|
|
|
|
|
|
Many of the old C APIs have been deprecated. I imagine that is the majority of your errors/warnings. You can turn that off using a compiler switch (you'll have to look that up as I don't have VS available at the moment).
These aren't e-books, but they are perhaps the best books you'll find for Win32 programming without MFC:
Programming Windows by Charles Petzold
Programming Applications for Microsoft Windows by Jeffrey Richter
Note: get the older editions as the newer ones have been written with C# (which was a mistake IMHO).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: Many of the old C APIs have been deprecated. I imagine that is the majority of your errors/warnings. You can turn that off using a compiler switch (you'll have to look that up as I don't have VS available at the moment).
Hi , its been a while. Yea , i got petzolds book and other books too and learnt C# , and its awesome!! Way better than win32 , i can build more powerful apps way faster! Without losing my head! (thats for anyone else doing win32)
About my problem , it seems the vc express does'nt come with the PSDK.
Look at this[^]
Hope that helped someone.
Gideon
|
|
|
|
|
Is there any way to trick the C++ compiler and get the value of a non-static member variable from a static method.
e.g.
class CDummy
{
public:
int m_myInt;
static void dummy();
};
void CDummy::dummy()
{
int x = m_myInt; ????
}
Thanks!
modified 9-Mar-17 17:16pm.
|
|
|
|
|
Not without passing a reference to the instance of your class.
I Dream of Absolute Zero
|
|
|
|
|
Yes ... its called make a non-static version of the method:
class CDummy
{
public:
int m_myInt;
static void dummy(const CDummy& dum);
void dummy() const;
};
void CDummy::dummy(const CDummy& dum)
{
dum.dummy();
}
void CDummy::dummy() const
{
int x = m_myInt;
}
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi,
I have outlook configured on my machine.
I need to send data (textual) to one email contact only .
Means I will have some text ready at some time interval and every tiem I read the data the data should go as email to this address using my outlook config.
How can I achieve this.
pathak
|
|
|
|
|
See here and here for examples of sending e-mail.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to get all the URLs (links) on the web page?
Leya
|
|
|
|
|
Use the IHTMLDocument interface to retrieve the <A> elements.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
i want to know,that as i insert a edit box on dialog box
and 10 buttons with number on them from 0 to 9.
now i want that when i press these 0-9 buttons
then that will be appear on edit box . I use a progress control on dialog box
and a dial button so that after entering numbers press dial and progress button start
moving
I want as in phone system when we press buttons they appear on screen
and when dial button is pressed phone dials.
Please mail me
|
|
|
|
|
m_sPhoneNumber += "1";
setDlgItemText(IDC_EDIT_PHONE_NUMBER,m_sPhoneNumber);
put that code on button click.
sPhoneNumber is a String.
this code might help u.
|
|
|
|
|
thank you
but this code does not sotore number on edit box as it replace preivious number
i wantr as we use in mobile phone
thank s
Please mail me
|
|
|
|
|
About how many times are you going to ask this question? It's been answered several times.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Here's the code for one more time.
You can call this function whenever the key is pressed and pass an integer to the function underneath based on what button is clicked on the dialog by the user.
m_editCtrl is the control variable for the edit box
In the header file declare the function as
void SetNewText(int p);
void CYourClass::SetNewText(int p)
{
CString s;
m_editCtrl.GetWindowText(s);
CString t;
t.Format ("%d",p);
s+=t;
m_editCtrl.SetWindowText (s);
}
Now to use the function simply do
SetNewText(1); //if the user has clicked 1 and so on
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 9:27 Friday 7th July, 2006
|
|
|
|
|
yogendra kaushik wrote: I want as in phone system when we press buttons they appear on screen
and when dial button is pressed phone dials.
try this :- http://www.codersource.net/mfc_array_controls.aspx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi All,
I am using SetTimer API to create timers in a UI Thread (CWinThread
derived class)
The code looks as follows ->
m_timerId=::SetTimer(NULL,0,1000,NULL);
where m_timerId is a member data variable.
My Message map & onTimer looks as follows.
BEGIN_MESSAGE_MAP(CMyThread, CWinThread) <br />
ON_THREAD_MESSAGE(WM_TIMER, OnTimer) <br />
END_MESSAGE_MAP() <br />
<br />
<br />
void CMyThread::OnTimer(WPARAM wParam, LPARAM ) <br />
{ <br />
if(wParam==m_timerId) <br />
{ <br />
<br />
<br />
<br />
} <br />
}
This code works!!!!!!!!!!!!!!!!
But SetTimer API documentation does not talk about the above usage.
(where in both hWnd and callback functions are NULL)
Has any one tried this kind of usage of SetTimer with CWinThread
object?
If yes, do let me know if you have encountered any problems.
Regards
PS : Most of the documentations talk only about SetTimer working with
either window object or a call back but never with CWinThread!!!. I
have also seen complicated work arounds to make SetTimer work with
CWinThread. So I am little concerned to use this approach.
|
|
|
|
|
kumar_subrahmanya wrote: But SetTimer API documentation does not talk about the above usage.
(where in both hWnd and callback functions are NULL)
Are you sure? Per MSDN:
hWnd
If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.
lpTimerFunc
If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue.
Either can be NULL independent of the other.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Well, MSDN says "If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue." What is application Queue? is it the message queue of the thread which started the timer or it is "THE" applications main message queue?
Here in my code, I have both hWnd and timer call back as null and I am recieving the WM_TIMER messages at my thread message Queue!!!
|
|
|
|
|
You can use WM_TIMER in CWinThread, but there may be problems.
I just finished a graphics processing application and I was using a timer in a worker thread, to do some minor stuff. Since WM_TIMER is a low priority message... during image processing and fast image Blting... the timer was not working correctly... some long delays at random intervals.
My research showed me that it was being caused by rapid WM_PAINT messages due to my flicker-free paint functions. For example, if the user grabbed a large image (several megabytes)on the screen and moved it around with the mouse... the WM_TIMER messages never reached the thread.
I redesigned my worker threads so they work in an infinite loop, with a custom sleep function. The starting and stopping of the threads are purely message based, works *much* better this way.
Note: this may or may not apply to your project.
You can read more about the problem on google:
http://www.google.com/search?hl=en&q=WM_TIMER+low+priority[^]
|
|
|
|
|
Hi thanks for the input. I will check how this would affect my project.
thanks again.
|
|
|
|
|
hi,
I need to create a delay in step of 250 micro sec..But GetTickCount API counts the tick in terms of milli seconds.
Is there any other method to achieve the same using inline assembly, but only issue is it shouldn't be processor specific/dependent...
can someone post a snippet for the same..
thanx..
|
|
|
|