|
If the return from this is 0x80040152 it is not being found in the registry. I suggest try the class id just as the next step of investigation. This HRESULT is either the client not registered correctly or using the incorrect ProdID.
|
|
|
|
|
hi,
im reading a large text file using fstream. below is my code:
<br />
char logfile[10] = "log.txt";<br />
char data[100];<br />
<br />
fstream open_logviewer(logfile, ios::in);<br />
<br />
while(!open_logviewer.eof()){<br />
open_logviewer.getline(data,100);<br />
cout << data << endl;<br />
} <br />
open_logviewer.close();<br />
because the file has so many lines of data, when the program is executed, it will run through the data quickly to the end of line. this makes it hard for the user to read the data.
how can i give user an option to probably press enter to view let say next 10 lines?
|
|
|
|
|
require user input using C++'s cin or C's scanf
|
|
|
|
|
hi,
erm what you're referring is read user input and print the particular line?
if it is, i'm actually looking to print the whole chunk but allowing user to able to read every 10 lines per screen, after which, they press tab or enter to continue next 10 lines.
|
|
|
|
|
hmm i got it. its pretty simple acutally. i just simply find the difference between the counter and the prev 50 page.
it looks like this:
<br />
char logfile[10] = "log.txt";<br />
char data[100];<br />
<br />
fstream open_logviewer(logfile, ios::in);<br />
<br />
int counter = 1;<br />
int prev = 0;<br />
while(!open_logviewer.eof()){<br />
open_logviewer.getline(data,100);<br />
cout << data << endl;<br />
<br />
if((counter - prev) == 50){<br />
prev = counter;<br />
system("pause");<br />
}<br />
<br />
counter++;<br />
} <br />
open_logviewer.close();<br />
<br />
|
|
|
|
|
nuttynibbles wrote: if((counter - prev) == 50){
What is the point of prev ? A simple counter from 1 to 50 is all that's needed, resetting to 1 every time it hits 50. Something like:
if(counter++ == 50)
{
system("pause");
counter = 1;
}
|
|
|
|
|
this idea also works. thks
|
|
|
|
|
Hey everyone!
I'm currently working on a project that is going to require access to various command line applications. Mostly in order to grab status updates from various processes that are running on the system.
A sample of the command line program would be as follows:
C:\Program\Folder>System.exe -Enable "10:22:00" -Disable "10:23:00"
SYSTEM ONLINE - 11/25/2009 10:22:35 GMT
SYSTEM ONLINE - 11/25/2009 10:22:40 GMT
SYSTEM ONLINE - 11/25/2009 10:22:45 GMT
SYSTEM ONLINE - 11/25/2009 10:22:50 GMT
SYSTEM ONLINE - 11/25/2009 10:22:55 GMT
SYSTEM OFFLINE - 11/25/2009 10:23:00 GMT
SYSTEM OFFLINE - 11/25/2009 10:23:05 GMT
SYSTEM OFFLINE - 11/25/2009 10:23:10 GMT
Etc. Etc. Etc.
I need to be able to grab that system status from this and other programs and return them to a GUI application in Visual C++.
How can I grab the resultant output of the console as a string? I realize that many people simply dump the data to a file and then read from the file, but I'm looking for something a bit more direct. Is this even the correct way to approach the problem of grabbing status from an external process? My restrictions are that it does have to be for Windows and in Visual C++.
Thanks for the help!
-N. Rackley
|
|
|
|
|
You will probably need to use the system() or _popen() call to get what you need. Take a look at the MSDN references[^] for more information.
|
|
|
|
|
|
Hi all..
I am facing a problem with the font selection in menu..
here the color of font is not changing once selected.. but the type and size everything is changing as per selection..
Iam using CreateFontIndirect
and below is my code for OnFont()
CWnd *pwnd = CWnd::GetFocus();;
int wID = pwnd->GetDlgCtrlID();
LOGFONT If;
CFont *font = new CFont();
if(wID==IDC_SAFE)
{
CFontDialog FontDlg(&If);
if(FontDlg.DoModal() == IDOK)
{
font->CreateFontIndirect(&If);
m_edittext.SetFont(font);
}
}
plz help me to solve it
|
|
|
|
|
I think you need to set the text colour independently of the font, with the value from the CFontDialog.GetColor() method.
|
|
|
|
|
thanku Richard...
n sorry for the late reply..
i tried implementing ur sggestion but dat too is not working....
|
|
|
|
|
sonualex wrote: i tried implementing ur sggestion but dat too is not working....
Sorry, but I cannot guess what is not working, you will need to explain what you have done and what results you are getting.
|
|
|
|
|
I am trying to create a ccomboboxex using createwindow function.but I get the old combobox look(3d gray).
How can I get the XP appearance combobox? Any idea? thank you.
|
|
|
|
|
It happens not only for controls you create but also for all windows.
There are several ways you can achieve this. the easiest is to include a manifest file to enable visual styles.
Manifest should have following name: appname.manifest. For example SomeApp.exe.manifest.
Include manifest file in the same directory as your executable module. That is it.
To avoid copying or including additional file in you distribution package, you can include manifest file as a resource in your project but this is a little bit more complicated.
JohnCz
MS C++ MVP
|
|
|
|
|
thank you for the anwser.
|
|
|
|
|
As JohnCz said, use a manifest file. The manifest needs to specify using the Common Control 6.0. Here's a sample (change the app name as you see fit):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.1" processorArchitecture="X86" name="KRM.Undecorate" type="win32" />
<description>Undecorate a C++ name.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
thank you for the anwser,but your way can't solve my question.
|
|
|
|
|
Strange. It is working for me...
Did you follow all steps?
Perhaps if you explained all steps you have taken it would explain why it does not work.
What is the name of your application?
What is the name of your manifest file.
Did you copy manifest text from Karl’s post?
Directory where did placed manifest file.
JohnCz
MS C++ MVP
|
|
|
|
|
Hi,
Given a Mapped Drive i.e.'F:\' Is itpossible to recover the Server Name and Path .
Regards,
Bram van Kampen
|
|
|
|
|
I thought the information was available in the 'Netshare' API's - these days its likely to be available through WMI as well - if only a bit more convoluted to access
'g'
|
|
|
|
|
|
You also can read the RemotePath key in HKEY_CURRENT_USER\Network\DRIVE_LETTER to get the mapping information
|
|
|
|
|
Thanks for that info - filed away for future use
'G'/Remote/via Blackberry
|
|
|
|