|
Just a moment ago, CPallini(Whom is one of the forum personnel_ gave me a suggestion on learning C++ and Windows Programming and i can ignore MFC, why does he say so?
|^-^| Willing to Learn is the light to my life |^-^|
|
|
|
|
|
ask him, my dear?
(just kidding)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Read a good book and learn C++ . Then you may read a good book on Windows programming but, at first, don't bother about MFC .
When you eventually reach a good knowledge of both C++ and Windows programming, then find out that you don't really need MFC .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Why is that so, if i learnt C++ and Windows Programming then i will not be using MFC, but i thought MFC are related to both C++ and Windows Programming, plus it also help you to create the necessary Class Files for you to program. Is there any books or website that offers this kind of teachings?
|^-^| Willing to Learn is the light to my life |^-^|
|
|
|
|
|
Oh don't worry about. Simply I don't like very much MFC . Indeed, if you want to be stuck with MFC , the book Rajesh R Subramanian suggested (Prosise's) is a good one.
Anyway if you need to do some C/C++ Windows programming, good C/C++ knowledge is a must, good Windows programming is a must too. On the other hand MFC isn't such a must. It is just a framework built on the top of the Win32 API . You can enjoy other frameworks or you may just roll your own classes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I see what you mean Pallini, thanks for the advice, because i am learning from the beginning as i am not very good in programming. I will be going to do a look up. By the way is there any website that can provide tutorials or projects that i can do, so that i can learn and also know how i have improve in building Windows Programs (E.g. Creating a simple e-learning tool)>?
|^-^| Willing to Learn is the light to my life |^-^|
|
|
|
|
|
scene_84 wrote: By the way is there any website that can provide tutorials or projects that i can do...
Why does everything have to come from the Internet? What happened to the days when folks thought up their own problems, even small ones?
Convert fahrenheit to celsius
Add up numbers from stdin stream
Write to and read from a file
Determine if a date is valid
And if algorithms are your thing:
Bubble sort an array of numbers
Add to and delete items from a linked list
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
David we're since a long time in the CUT & PASTE era. How old are you?
BTW Probably we'll end up into the CUT ONLY era.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Read a good book and learn C++. Then you may read a good book on Windows programming but, at first, don't bother about MFC.
That is stupid.
Noone in his right mind would want to program Windows in C alone. And that is what the Win32-Interface is.
MFC is stupid enough, without having to program "C with classes".
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
1.jhwurmbach wrote: That is stupid.
Off course that is going on your arrogant assumptions.
2.jhwurmbach wrote: Noone in his right mind would want to program Windows in C alone. And that is what the Win32-Interface is.
See point (1). I'm not talking about plain C , however, programming Windows using plain C is an option: if you don't like that kind of programming then you think nobody will do?
3.jhwurmbach wrote: MFC is stupid enough
I don't agree. Some aspects of MFC are good. But I don't like the whole MFC .
4.jhwurmbach wrote: without having to program "C with classes".
Programming Windows with C++ using Win32 is not programming C with classes. It's programming C++ exploiting a very-very-good C API (while I can't say very-very good about MFC Framework).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi
I want to generate a Data Report in VC++ 6.0 .
I done data report in VB, but not in vc++. Is it possible to generate a data report in vc++ .
Give me the suggestion about this. Report generating in Data Reporting , crystal or any other way I want just an report viewing and the print out of that.
Regards
shakumar
shakumar
|
|
|
|
|
shakumar_22 wrote: Is it possible to generate a data report in vc++
The following is a report I generated using C++
If Google is not accessible in your location, complain to your ISP
led mike
|
|
|
|
|
have a query on Combo box..
i have a file which contains one set of values. and the there is heading also which is seperated by semicolons[;], now i want to read the first line which i have done and then use some function to seperate the headings and load it into the combo box. how can i do this? i hope what ever i have told u is clear.
the first line can be something like this
Name;age;sex;address;
this is in a file and take for example there are 500 values.
modified on Thursday, March 27, 2008 6:55 AM
|
|
|
|
|
Chandrasekharanp wrote: the first line can be something like this
Name;age;sex;address;
this is in a file and take for example there are 500 values.
it looks like detail view in explorer right, why you choosed combo box i can't understand, list view with report view style will be suitable. some thing like List Control[^]
To seperate the items delimitted by semicolons you may use strtok, for MFC CString::Tokenise. Look for CString::Tokenise[^] for sample code.
|
|
|
|
|
no its not a detailed view. its just the names in the first line..
goes like this
name
age
sex
address
i want it to display like this in the combo box.. i am very sorry to say that the list box does not fit into my requiremtents..
|
|
|
|
|
anyway Tokenize API is useful, I think.
|
|
|
|
|
Perhaps this will help (non Unicode console application):
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
ifstream ifs("C:\\data.txt");
if (!ifs)
{
cerr << "Failed to open input file!" << endl;
return -1;
}
string first;
if (!getline(ifs, first))
{
cerr << "Failed to read first line of line!" << endl;
return -2;
}
string word;
istringstream iss(first);
while (getline(iss, word, ';'))
{
cout << word << endl;
}
return 0;
}
Steve
|
|
|
|
|
i shall certainly check this.. thanks
|
|
|
|
|
hi
i have develop small project using VC++ 6.0 IDE, & my code is purely in C Language. i would like to know that how can i create setup of my project just like VB or VB.net.
i have used few external header files & library files too.
|
|
|
|
|
Google for inno setup.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
My application fails after making a call to the Windows CryptAcquireContext API. I get the following error code NTE_BAD_KEY_STATE ( 0x8009000BL ).
Code snippet and details below:
////////////////////////////////////////////////////////////////////////////////
/* @func UINT32 | get_key |
* Description: Get encryption key. In order to do this need to
* acquire encryption context and hashing object.
*
*---------------------------------------------------------------------
*/
////////////////////////////////////////////////////////////////////////////////
UINT32 get_key(TCHAR * szPassword, HCRYPTPROV * phProv,
HCRYPTHASH * phHash, HCRYPTKEY * phKey)
{
...
...
// Get handle to user default provider.
rc = CryptAcquireContext(phProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, 0);
if(!rc)
{
lRet = GetLastError();
if (lRet == NTE_BAD_KEYSET)
{
// create default key container
if (!CryptAcquireContext(phProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
CRYPT_NEWKEYSET))
{
lRet = GetLastError();
}
}
}
...
...
}
The first call to CryptAcquireContext() here fails with NTE_BAD_KEY_STATE, and there isn't sufficient information available on MSDN bout the error code. All I got was that the error returned from the failing API suggests that the user password has changed since the private keys were encrypted. But there weren't any sort of user modifications done recently on my machine.
The issue occurs on a Win2K3 HP server. But it seems to be happening only on one of my servers and works fine on others.
Any ideas as to what might be going wrong here? I know that re-installing the OS here would fix this (cause it happened on another machine in the past and the only way out that time was re-installing the OS). But re-installing the OS here would mean a lot of work to be re-done at this point for me. Has anyone encountered such a problem in the past, if so, how was it resolved?
Thanks in advance!
- Benson
|
|
|
|
|
Hi all,
i am writing the code for making shortcuts at particular location.....
like desktop and quick launch.....
i am creating them using com.....
now my problem is if i want to change the shortcut name...like file name is abc.exe and i want that exe name to be xyz.exe....
how could i do this....
thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: i am creating them using com.....
possibly using the reply from CP for How to create and resolve a shortcut[^]
first of all you didn't mind to replied whether that is useful and next the link is clearly documented.
HRESULT CreateShortcut(/*in*/ LPCTSTR lpszFileName,
/*in*/ LPCTSTR lpszDesc,
/*in*/ LPCTSTR lpszShortcutPath
)
create new shortcut or resolve the shortcut and change the target file name
|
|
|
|
|
Hi,
I have been using the window spy http://www.codeproject.com/KB/applications/WindowScraper_Utility.aspx[^]. I need to avoid masked input textboxes with passwords. How can this be done?
thanks
int count, nItems;<br />
BOOL bGot=FALSE;<br />
CString strItem;<br />
char winTxt[5000];<br />
memset(winTxt, 0, 5000);<br />
<br />
if(strcmp(szClassName, "ListBox") == 0)<br />
{<br />
CListBox lb;<br />
lb.Attach(hwndFoundWindow);<br />
nItems=lb.GetCount();<br />
for(count=0; count < nItems; count++)<br />
{<br />
lb.GetText(count, strItem);<br />
strItem+="\r\n";<br />
strcat_s(winTxt, strItem);<br />
}<br />
lb.Detach();<br />
bGot=TRUE;<br />
}<br />
<br />
if(strcmp(szClassName, "ComboBox") == 0)<br />
{<br />
CComboBox cb;<br />
cb.Attach(hwndFoundWindow);<br />
int nItems=cb.GetCount();<br />
for(count=0; count < nItems; count++)<br />
{<br />
cb.GetLBText(count, strItem);<br />
if(cb.GetCurSel() == count)<br />
strItem+=(" <- Selected");<br />
strItem+="\r\n";<br />
strcat_s(winTxt, strItem);<br />
}<br />
cb.Detach();<br />
bGot=TRUE;<br />
}<br />
<br />
if(!bGot)<br />
SendMessage(hwndFoundWindow, WM_GETTEXT, 5000, (LPARAM)winTxt);<br />
<br />
SetDlgItemText(hwndDialog, IDC_WINDOWTEXT_EDIT, winTxt);<br />
<br />
return lRet;<br />
}
|
|
|
|
|
Can you not use GetClassName, and compare that against EDIT (verify that!),
then if it is any edit box, use GetStyle, and check that for the ES_PASSWORD flag?
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|