|
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.
|
|
|
|
|
|
If you're in the code that scrapes text, and you know the window class, and you can check the style, why can't you just avoid the GetWindowText call, and set the text to display in your app as "<password -="" i="" aint="" showing="" you!="">", or such.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
thanks but i do not know how to implement this if statement as during the window operation it checks combo boxes and checkboxes, and this new one will be called passwordcheck.
|
|
|
|
|
What's wrong with going through the code you showed in your first post line by line with a debugger?
It's already got If we are a combobox if, and an if we are a checkboxetc.
Just add another one in the same way for the edit class. You can even use cut and paste.
Write a small app, with an edit box with it's ES_PASSWORD style set.
If you don't know the name of that class (I'm fairly sure it's [gasp!] EDIT), then the debugger will tell you.
So.... (crudely)
If (!lstrcmp (ClassName, _T("EDIT"))
{
DWORD dwStyle = ::GetWindowLong (hWnd, GWL_STYLE);
if (dwStyle & ES_PASSWORD)
{
StringReturn = "Mind your own business";
return StringReturn;
}
}
I hope that helps more.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
I think its cedit but ill find out.
thanks for your help
|
|
|
|
|
CEdit is the MFC Class name.
You want the Windows Class name - as used by ::RegisterWindowClass, ::CreateWindow, etc.
Anyway, by now you should have had some answers, so I hope it went well for you.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Can i use pocket PC to run exe file generated by C++ code written with Microsoft Visual Studio 2005 ?
How ?????
Please help me .
ahmed.rayan@hotmail.com
|
|
|
|