|
I am using the "Powercfg.exe" (Power Settings Command-Line Tool) for changing the power settings on different platforms.
The power options (switches) I am using are
1. Enable Hibernation (/HIBERNATION)
2. Enable Device wake (/DEVICEENABLEWAKE)
For Windows XP and Vista these switches work perfectly fine.
The problems I am facing are on Win2K3 and Win2K
1. Win2k3: "Powercfg.exe" do not have the “/DEVICEENABLEWAKE" switch. Is there any another way to configure the device wake enable settings on Win2k3?
2. Win2K: do not have the "Powercfg.exe" command line tool, if we are using the Win2K3 "Powercfg.exe" utility to change the settings. The same issues are there for Win2K as well.
Apart from the command line configurations are there direct APIs available?
|
|
|
|
|
Hi all,
please explain me in CEMAPI having any function which is having same characterstics like PROVIDER_SPECIFIC_MESSAGE_CLASS .
please help me hor this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi all,
i m using cemapi to sending sms, for sending texe sms use value "IPM.Note" or "IPM.SMStext".
now i want to send a msg that should be displayed immediately but not stored,
like same when i set PROVIDER_SPECIFIC_MESSAGE_CLASS to PS_MESSAGE_CLASS0 .
i think this can be done with use of PR_MESSAGE_CLASS in CEMAPI.
please tell me i m on right track,if not please suggest me right function for this.
so please what value can i use?
please help me.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi
I am using visual studio 2008 VC++9.0 version with crystl32.ocx version 5.2
I want to use crystal control with setselectionformula()..My application display E instead of displaying report..Its because of exception..
Pleaselet me know how to come out from exception.
Thanks,
Azhar
Please see my code below:
void CAssetReport::OnBnClickedEmployeeidwise()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CCrystalCtrl *m_ControlEmployeewise = (CCrystalCtrl*)(GetDlgItem(IDC_CRYSTALREPORT5));
char cEmployeeID[80];
CString str1;
if(m_nEmployeeID == 0)
{
AfxMessageBox(_T("Employee ID is missing...!"));
CEdit *edit = (CEdit *)GetDlgItem(IDC_EDITEMPID);
edit -> SetFocus();
edit -> SetSel(0,-1);
return;
}
sprintf_s(cEmployeeID,"{Employees.EmployeeID} = %ld",m_nEmployeeID);
str1 = cEmployeeID;//{Employees.EmployeeID} = 76745
m_ControlEmployeewise->SetReportFileName(_T("C:\\Projects\\ServiceRequestApplication\\Report\\Employeewise.rpt"));
m_ControlEmployeewise->SetSelectionFormula(str1);
m_ControlEmployeewise->SetDiscardSavedData(TRUE);
m_ControlEmployeewise->SetAction(TRUE);
UpdateData(FALSE);
}
|
|
|
|
|
Hi,everyone!
The style of my CListCtrl is large icon.When I try to insert an item into it,the icon of the new item is always at the end. But the index of the new item is correct.
For example:
before insert F
A C E
B D
after I insert F to index 2,like this:
m_ListCtrl.InsertItem(2,_T("test..."),0);
A C E
B D F
though index of F is 2.
attributes of the list control:
autoarrange-true;sort-none;alignment-left
Anyone can help me?
Thanks in advance.
|
|
|
|
|
Could you try with autoarrange set to false.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your answer,superman.
Actually I've tried this but failed.
After all, i need the autoarrange attribute when removing items.
Now my solution is sorting items by index mannually.
I am waiting for better solutions.
|
|
|
|
|
Is there any way to read files such as .doc, .xls and load their data into a buffer? I used fstream functions to open a file, get its data and put its data in another file. on .txt files it's able to take that data and successfully place it in another txt file fine. however it's not the same for .doc or .xls files (get weird characters, possibly japanese ). was wondering if anyone could suggest an alternative, or a fix on reading data from non .txt files properly.
thanks
|
|
|
|
|
Well, .doc and .xls files are binary files. They do not only contain text, but also all extra information (formating, styles, ...). Otherwise, where would this information be saved ?
If you want to read the data in them, you have to use automation (google for word automation and excell automation). The subject is a bit too broad to cover here.
For other file types, it really depends of which type of file you want to open. Each file type has its own format, and you either need to parse the file accordingly to the format (which is probably a though job) or find libraries that do that for you.
|
|
|
|
|
Just the thing I was afraid of
thanks Cédric
|
|
|
|
|
|
I've heard of the ADODB abstraction class, and I've seen it used successfully in VB codes (loading as bytes), but would that come under managed C++?
thanks
|
|
|
|
|
No, the class I referred to is not managed code.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I'm an experienced mainframe developer familiar with old world languages (COBOL, Assembler etc). I've recently written a couple of C batch programs, now successfully in production. I've now been briefed to write a C subroutine, for use by non C main programs, and have come across a fundamental problem: How do I exit a C subroutine? Is this a design issue ie should the code flow return to the top level where a normal'return' will take control back to the calling code or is there more to it?
|
|
|
|
|
The subroutine in C language is called as function.
Do you mean that you have one function which calls another function and soon?
If so, yes you have to keep returning from the functions, either using the return statement or by reaching the end of the function, till you reach the top level function.
Whenever a function calls another function, it puts the return address on the stack just before the second function is called. So if you have a deep level of function calls, the stack has to unwinded properly.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your reply; no, my query was about a seperately compiled piece of non-'C' code calling my piece of seperately compile 'C' code. But I think your answer was correct; I need to treat my code as a function so that control returns to the caller by going up the stack and exiting via the final 'return'.
|
|
|
|
|
Andrew Jenkinson wrote: How do I exit a C subroutine
The 'return' statement. Either 'return' for a void function, or 'return value for a non-void function. A void function can also return by reaching hte end of the function. Here are some examples:
void VoidFn(int value)
{
if (value < 0) return;
printf("%d", value);
}
int NonVoidFn(int value)
{
if (value >= 0) return value;
return -value;
}
You can return from anywhere in a C function, but many people recommend using only a single exit point. Personally, I take the pragmatic approach - if it makes sense to return earlier than the end of a function, then just do it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
If you've done assembler programming, you should find C very familiar, or easy to pick up, since it mostly operates in a very similar way. You can even view the high-level constructs as wrappers or macros *
Mind you, I'm amazed (or horrified) that wherever you work is just moving from COBOL into C (legacy apps I guess). You've a lot of catching up to do...
[ * OK, that's a huger over-simplification with modern compilers, but for the most part you can convert assembler into C very easily, and vice versa ]
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
You're right, I've quite enjoyed using C, though I still feel more in control working in assembler. Guess it's an age thing These last 10 years or so have been spent on migration projects, working for companies moving away from their legacy applications which is why I'm picking up things like C and .NET (I'm an MCP & MCTS now, for all the good it does me!) My specialisation is a mainframe commisioned by NASA as a number crunching machine for the moon project, which shows its age. These machines tend to run large applications which take a lot of redeveloping which is why some still exist.
|
|
|
|
|
And there was me thinking NASA had the latest, greatest systems on the planet Although, I have seen pictures of the shuttle with several laptops runnning the "real" flight code, and interfacing to the outdated flight computers, so I suppose I shouldn't be surprised.
As an amateur astronomer and spaceflight fan I've been following the technology developments for a long time - in fact I started programming about a year after Armstrong and Aldrin stepped onto the moon. Even then the hardware being used was a bit behind the leading edge, although I can well understand that reliability and reproducability play a huge part in choosing flight hardware. I bet there's still some code running today that was written in the 60's...
Anyway, I'd highly recommend a few home-brew projects to get more familiar with C and C++ - there must be a few ideas you've been thinking about for years that you could try out, and use to learn the new stuff you'll more than likely need in years to come. I spend all day writing "work" code, then relax in the evenings by writing "my" code. I can mess about on whatever I want, learn new stuff, and it doesn't matter if it's never finished.
Although, I suppose I'm lucky in my job - a bit of C# for tools development and non-critical code, C++ for the proper engine coding, a bit of Python thrown in, and assembler or IL for those "shave off the last nanosecond" critical bits. And we get loads of cool toys as well
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Hi All
I need to connected Mysql through mfc code.I have found article which is very good.They all are advice to insttal drive ODBC.I do it and it's working.But i have a question about that,can i make connection without any external driver.
Plz advice me
|
|
|
|
|
I am not overly familiar with ODBC but I have had to write applications that need to communicate with a database.
Check out
the MySQL C API
http://dev.mysql.com/doc/refman/5.0/en/c.html[^]
the C++ wrapper for the MySQL C API
http://tangentsoft.net/mysql++/[^]
Also if you are communicating with a web server database consider writing a server side web script to handle database queries and communicate with it with.
URLDownloadToCacheFile
http://msdn.microsoft.com/en-us/library/ms775122(VS.85).aspx[^]
This might or might not be reasonable depending on what you are trying to accomplish, but it is probably the quickest and easiest way to get the job done for basic web database queries.
Chris Smith
|
|
|
|
|
thanks for reply.You have given me this link but sorry it's not use for me.
My question is,Can i make connection without any ODBC Driver?
|
|
|
|
|
These are the available connectors[^].
As you see, there is a C++ connector - but that uses classes that MySQL provide, not the MFC classes. I think that's the closest to what you're asking for.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hai all,
in vc++ 6.0, for a dialog based application, is it possible to hide its instance on task bar?
please let me know any clues on how to achieve this.
thanks in advance.
|
|
|
|