|
Hii all,
can anybody help me in reading event log files via windows APIs and c++.
Thanks in adavance...
T@SU
|
|
|
|
|
|
Thanks for your informatiion... but i what i am looking for..
i have to read AppEvent.Evt from ..system32/config and i have to extract the description... of error
thanks alot
T@SU
|
|
|
|
|
T@su wrote: i have to read AppEvent.Evt from ..system32/config...
You do not read the event file(s) directly. There is an API for doing that. Hans' article goes over all of this very well.
"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
|
|
|
|
|
i am using dshow to play a video. (i am using dx9)
top of my project, i set,
#include <dshow.h>
#include <d3d9.h>
#include <vmr9.h>
...
in Debug, the program runs successfully,
when i changed to release, it has link error,
error LNK2001: unresolved external symbol _CLSID_NullRenderer
error LNK2001: unresolved external symbol _IID_ISampleGrabber
error LNK2001: unresolved external symbol _CLSID_SampleGrabber
error LNK2001: unresolved external symbol _IID_ICaptureGraphBuilder2
when i change Debug again, it can not be complied with the link error also.
do you have any idea?
thanks.
Lei
|
|
|
|
|
|
thx. it works.
|
|
|
|
|
Hello,
I am creating a installer for my application I am trying to execute custom action in InstallUISequence
Here is my code
<custom action="InstallSomething" before="InstallFinalize">PROP1=1 OR PROP2=1
Here i am setting PROP1 and PROP2 using checkboxes. The problem I am facing the condition is not working for custom action tag,
I am using Wix Installer version 2419.
Thanks in advance.
Abhi Lahare
|
|
|
|
|
Abhi Lahare wrote: I am using Wix Installer version 2419.
Buddy, it would be better you ask this question in WIX support forum, here i believe very few people are aware of this installer, generally people prefer installar shipped with VisualStudio or MacroVision Installshield on paid side and Innosetup on free side.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
you forgot NSIS :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Nelek wrote: you forgot NSIS
off course;)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I have created a service not specifying the username/credentails i.e. local-account. I am trying to change the user to "domain\username" dynamically using ChangeServiceConfig API. This API always returns me error code 87 i.e. “The parameter is incorrect”.
I have explained the problem below. Does anyone why this behavior?
I have detailed the steps below:
I have an issue. I create a service under the local system account. After that I am trying to change the user to domain\user. E.g.: if my domain name is “MSDN” and username name is “me”, I am trying to change the user credentials to “MSDN\me” using the ChangeServiceConfig API. This API is always throwing me an error 87 i.e. “The parameter is incorrect”.
#define SZSERVICENAME “Trial”
ServiceCreate()
{
schSCManager = OpenSCManager(NULL, // machine (NULL == local)
NULL, // database (NULL == default)
SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE // access required
);
schService = CreateService(schSCManager, // SCManager database
TEXT(SZSERVICENAME), // name of service
TEXT(SZSERVICENAME), // name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_INTERACTIVE_PROCESS|SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, //SERVICE_DEMAND_START start type
SERVICE_ERROR_NORMAL, // error control type
szPath, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
TEXT(SZDEPENDENCIES), // dependencies
NULL, // LocalSystem account
NULL); // no password
}
ChangeServiceParms()
{
//Domain = “msdn.try.com”, computer name is “comp”
LPTSTR szServerDNS = “comp.msdn.try.com”;//Fullname of the computer
LPTSTR szAccountDN = “MSDN\me”;// User to which I am trying to logon
schSCManager = OpenSCManager(szServerDNS,
NULL,
SC_MANAGER_CONNECT );
BOOL success = ChangeServiceConfig(service,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
szAccountDN,
NULL,
NULL);
if(!success)
{
DWORD err = GetLastError();
}
}
|
|
|
|
|
Hi all,
I would like to install and configure the postgresql from my MFC code! If it is possible?
Thanks in advance
surezsu
-- modified at 5:32 Wednesday 28th November, 2007
|
|
|
|
|
I basically have three group boxes.
The first group box has 2 radio buttons with labels reading “Choice A” and “Choice B”
The second group box is entitled “Choice A” and has several radio buttons within it.
The third group box is entitled “Choice B” and has several radio buttons within it.
I basically start off the program with group boxes “Choice A” and “Choice B” and their contents invisible.
Now, what I can’t figure out is:
When I click “Choice A” in the first group box, I want the “Choice A” group box and its contents showing up (with “Choice B” and its contents still invisible) and vice-versa.
I don’t necessarily need code, just a push in the right direction.
I’ve looked at several tutorials involving adding member variables and such to the radio buttons, but the tutorials were for an older version of Visual C++ and the ClassWizard has changed enough to cause conversion issues when I (attempted to) follow along.
However, I’m hoping the answer will be a simple “on push, choiceA.radiobutton1.visible=true;” type of thing.
Thanks in advance.
|
|
|
|
|
This seems to be C#, in VC++ I would make it like...
supposing you have member variables for every element...
If (m_rbChoiceA.GetSelect ())
{
m_rbChoiceA_1.ShowWindow (TRUE);
;
m_rbChoiceB_1.ShowWindow (FALSE);
}
and the opossite when B is selected.
I hope it helps you a bit, sorry but I didn't use C# yet.
BTW, I think is better to enable/disable than show/hide, I had a endless loop in OnPaint bcause of ShowWindow because it sends a "redraw" message internally.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Add the code below in the OnInitDialog function call
where IDC_STATIC is ID of Group box and IDC_RADIO3 the ID of the Radio Button. This may be different for your application hence needs to be changed accordingly.
<br />
GetDlgItem(IDC_STATIC)->ShowWindow(SW_HIDE);<br />
GetDlgItem(IDC_STATIC1)->ShowWindow(SW_HIDE);<br />
<br />
GetDlgItem(IDC_RADIO3)->ShowWindow(SW_HIDE);<br />
GetDlgItem(IDC_RADIO4)->ShowWindow(SW_HIDE);<br />
<br />
GetDlgItem(IDC_RADIO5)->ShowWindow(SW_HIDE);<br />
GetDlgItem(IDC_RADIO6)->ShowWindow(SW_HIDE);<br />
This will make sure that the 1st time you start your application, the 2 group boxes are visible.
Now handle the Single Click event of the 2 Radio buttons.
Add the following code in the "Choice A" radio button event handling function.
<br />
GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW);<br />
GetDlgItem(IDC_RADIO3)->ShowWindow(SW_SHOW);<br />
GetDlgItem(IDC_RADIO4)->ShowWindow(SW_SHOW);<br />
If you want dont want Group A radio buttons/box to be visible when you click on the 2nd radio button, please hide the same.
|
|
|
|
|
char** Buf[ 8 ] ;
how to allocate and use this pointer ?
Thanks & Regards
|
|
|
|
|
char ** Buf[8];
int i,j;
for (i=0; i<8; i++)
{
Buf[i] = new char * [10];
}
Buf[0][0] = "foo00";
Buf[0][1] = "foo01";
Buf[0][2] = "foo02";
Buf[1][0] = "foo10";
for (i=0; i<8; i++)
{
delete [] Buf[i];
}
BTW: until you can't figure how to use it, don't use it.
BTW2: maybe hard-wired 8 as buffer size is not a good idea. Use an const instead.
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.
|
|
|
|
|
thanks CPallini
|
|
|
|
|
Nice Pointer arithmetics
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Nice Work
|
|
|
|
|
std::vector<std::string> is pretty much better if you code in C++.
|
|
|
|
|
toxcct wrote: std::string
I prefer CString over std::string. as it is much easy to use than std::string and in my way more robust.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: as it is much easy to use than std::string and in my way more robust
>> more easy to use
that's only your point of view. std::string is not that difficult to use, and is much more powerful when mixed with the other STL classes, especially the algorithms.
>> more robust
I don't trust this. can you give some proof about this ?
BTW, i really don't like the idea of mixing MFC and STL.
either choose std::vector<std::string> if MFC is not a must, or CStringArray , but vertainly not std::vector<CString> .
|
|
|
|
|
toxcct wrote: MFC is not a must, or CStringArray, but vertainly not std::vector<cstring>.
CStringArray has less capability than vector and CString Mix. this is some time called Mixed mode programming;P
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|