|
Oké, thank you very much ... That bypasses my problem for now... Still got some other UAC problems with restoring an MS-SQL database, but I'll first have look into that.
Thanks
|
|
|
|
|
Please check UAC for windows Vista.
Please refer this[^] for more information. Hope this would help you.
Regards,
Paresh.
|
|
|
|
|
Hi,
I want a tab in TabCtrl to be Grayed. Can anyone pls tell me how to do it?
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
Refer C++ Q & A[^] from MSJ , march 1998.
Prasad
MS MVP - VC++
|
|
|
|
|
Does anyone know why there is no standard means to retrieve the code-page number in either C or C++?
You can set the locale including the code-page, but you can not retrieve the page being used by the currently selected locale. Yes I know MS provides a function for retrieving the number (I have used it in the past), but I need a generic (non-vendor specific) way to retrieve it or it is useless for my purposes.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Code pages are vendor-specific and only used by Microsoft and IBM (AFAIK).
|
|
|
|
|
Thank you very much!
I investigated and saw the various code page mappings, which made me feel much better about my requirement of no vendor specific code and no knowledge of code page.
Does this also apply to Unicode in any way?
Could you look at my original post “MBCS - Character range generation”[^], to see if what I was attempting is even possible to do generically?
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Is _getmbcp() of any help, or is that still MS-specific?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Is _getmbcp() of any help, or is that still MS-specific?
Yes it is. Any function beginning with ‘_’ is MS-specific and others without the under-bar may also be vendor specific. Some times it is hard to tell.
As Markkuk pointed out, even code-pages are vendor specific; therefore I can not use them at all.
I have been investigating ‘isleadbyte’ and ‘mblen’ and find that even though MS marks them as ANSI, that they are not listed in the C standard.
The code must be as generic as possible. It is only this top level parsing template that is giving me trouble, when it comes to generating ranges of characters. The lower level templates have no knowledge, nor care, about such details.
See my answer to Markkuk for a link to original problem.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
What I am doing may be stupid. But if I want to do like this then what to do...
In the doubleclick of the tree view item I delete that item. In that case the application crashed. What to do if I want to delete the item in the doubleclick.
What is the reason that it is crashing.
Regards
Anil
|
|
|
|
|
Almost sounds like some still points to the item..
Gotta post some code..
|
|
|
|
|
For your reference I make the code like this...
<br />
void CBackupTreeBar::OnNMDblclkBckTree(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
if( IsSelectFile() == TRUE ){<br />
<br />
m_BackupTree.DeleteItem( m_BackupTree.GetRootItem() );<br />
<br />
}<br />
*pResult = 0;<br />
}<br />
This code will crash...
But If make *pResult = -1; it is working.
Of course the tree items won't be there.
Regards
Anil
|
|
|
|
|
You're deleting a tree item in an event handler that is processing an event fired by that very item. Chances are, the tree control is going to do some other work after your handler returns that will involve that tree item. You could see how deleting it would be a bad idea.
|
|
|
|
|
_anil_ wrote: m_BackupTree.DeleteItem( m_BackupTree.GetRootItem() );
You are deleting the whole tree item here, is this your intension?
_anil_ wrote: *pResult = 0;
}
This code will crash...
But If make *pResult = -1; it is working.
I'm not sure, but i think this is why your code get crashed.
If you set pResult is 0, then the frame work thinks that you didn't handle this notification,so it'll proceed with its task. But you already deleted the tree items, so its crashing.
If you set values other than zero then, the framework knows that you handled the notifaction and it does nothing.
Do your Duty and Don't expect the Result
|
|
|
|
|
In all applications; by double clicking the tree will be expanded. You can create a context menu with a button as delete. on righ clicking on the tree or item invoke the context menu and click the delete button to delete the item.
Regards,
Syam
|
|
|
|
|
I ran into this issue about a year ago and the issue is exactly what Michael Dunn stated.
And I fixed the problem the same way suggested by syampi.
|
|
|
|
|
Not able to access child dialog object, Assert Error..
//Pointers to dialogs
CDialog * pCMyApp;
CDialog * pCChildDialogs[5]; //array of dialogs
.
.
.
void CMyApp::function()
{
//trying to SetWindowText to one of the child dialogs objects.
pCChildDialog[0]->GetDialogItem(IDC_STATIC1)->SetWindowText(mystring); //MVS2005 intelliSense shows this path ok
}
Other functions "PCChildDialog[N]->???" seem to work fine within this CMyApp function.
But in this situation I get an Assert Error..
and it drops me off here
void CWnd::SetWindowsText(LPCTSTR lpszString)
{
......
ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); <------------
|
|
|
|
|
Hehe, go figure.. get stumped on something for hours and figure it out only seconds after writing a post..
pCChildDialog[0]->SetDlgItemTextW(IDC_STATIC1, mystring); //This fixed it
|
|
|
|
|
Hey fellas..
Need a lil help..
I am starting up with a application of cryptography and steganography. But i am lil confused like which language to use. I have option to do it in C++(borland), C++.NET OR C#.NET. Not VC++...
All depends in which language would i get more reference over the net and more help.
Can C#.NET perform all the tasks that C++ can. I want to know it now so that i dont end up in a mess. As in stego i want to use carriers like .mp3, .jpeg, .pdf etc. So would that be fine with C#.NET.
Any suggestions are welcome...
Thanks a lot
|
|
|
|
|
I recommend you to:
1) write a brief design-document for the application you wish to write;
2) while writing, decide what components you will require (cryptography, compression, etc.)
3) search google/yahoo/whatever for that component. The first programming language to have all components you need written - that is your choice.
But at first, look at your programming skills.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hello everybody, I'm writing a program to take the contents for several .txt files and make them into one single .txt file. The separate txt files have to go in the single file at a certain order.
The problem with the code (see below) is that when I call getline(file,bline), bline is left empty after the call I don't understand what could be the problem. The file opens properly according to file.is_open but getline doesn't read. Here is the code:
<br />
<br />
fstream file;<br />
<br />
string bline;<br />
int i,j;<br />
<br />
<br />
string month[]={"01","02","03","04","05","06","07","08","09","10","11","12"};
string year[]={"1999","2000","2001","2002","2003","2004","2005","2006"};
<br />
for(j=0;j<=7;j++)<br />
for(i=0;i<=11;i++)<br />
{<br />
string fname="E:\\Month\\"+month[i]+"_"+year[j]+".txt";<br />
<br />
file.open(fname.c_str());<br />
if(file.is_open()){<br />
<br />
while(!file.eof()){<br />
ofstream ofile;<br />
ofile.open("C://allfile.txt",ios::app);<br />
getline(file,bline);<br />
ofile<<year[j]<<'\t'<<month[i]<<'\t'<<bline<<endl;<br />
}<br />
<br />
cout<<"Finished month "<<i+1<<" year "<<j+1999<<endl;<br />
<br />
}<br />
else<br />
cout<<"Cant open file"<<endl;<br />
<br />
<br />
}<br />
|
|
|
|
|
if you need to concatenate all the files, why do you read line by line ?
just read the entier file...
|
|
|
|
|
The files are huge... approx 9mb
|
|
|
|
|
that's ok you know. now constructors provide 1GB RAM
but if you think reading 10MB in one run is two much, you could always read by packets of 1 or 2 MB, without caring too much of the file contents... (because at last, all the characters will be moved)
|
|
|
|
|
Try something like this:
========================
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream> // For "cout" and "cerr".
#include <fstream> // For "ofstream" and "ifstream"
#include <string> // For "string"
#include <cstddef> // For "size_t"
int main()
{
using namespace std;
// Open the output file.
ofstream outFile("C://allfile.txt");
if (!outFile)
{
cerr << "Failed to open output file!" << endl;
return 1;
}
static const string months[] = {"01","02","03","04","05","06","07","08","09","10","11","12"}; // these are all the months in the files
static const string years[] = {"1999","2000","2001","2002","2003","2004","2005","2006"}; // and these are all the years
for (size_t m=0; m<sizeof(months)/sizeof(months[0]); ++m)
{
for (size_t y=0; y<sizeof(years)/sizeof(years[0]); ++y)
{
// Build the filename.
string fname = "E:\\Month\\" + months[m] + "_" + years[y] + ".txt";
// Attempt to open the input file.
ifstream inFile(fname.c_str());
if (inFile)
{
// We opened it so append it the the output file.
cout << "Appending '" << fname << "'..." << endl;
outFile << inFile.rdbuf();
}
else
{
// We failed to open it.
cout << "File '" << fname << "' not found!" << endl;
}
}
}
return 0;
}
Steve
|
|
|
|