|
TPN wrote: I now try to develop an application that can help the administrator monitor user file operations such as copy, delete, rename... but I don't know how and where to start. Could you please show me how to.
look at ReadDirectoryChangesW api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
How can I compile my program in 2 or 3 different languages using visual studio??
The main problem is the resources file (.rc): how can I, for example, use the same menu with the same IDs, changing only the strings (whithout re-write everything)
Is there a way??
Cheers,
Russell
|
|
|
|
|
in the property of your menu, check the language. then you can duplicate the resource, and set a language for each.
|
|
|
|
|
tnx tox,
... but 2 precisations:
1- to choose the desired menu during the compilation shell I ONLY set the language on the property Resource/General/Language
2- I suppose that in this way every time that I add a new menu item it appears only on the selected menu', not on the others...right??
Cheers,
Russell
|
|
|
|
|
1- the resource choosen will be the one at the same language as the system first.
2- yes, you have to add the correct translation in all the resources.
|
|
|
|
|
Hi All,
Is it possible to call a web service from a dll, or is there any funtion that exists to perform this action.
Thanks in advance
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
i use gSoap for this (Google it). it builds a set of proxy classes from your web service interface which handle all of the communication between C++ and the service. it can be extended to use compressed XML (with zLib) and HTTPS (with OpenSSL), if you need that.
|
|
|
|
|
Thank you Chris ... I'll check it out ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
I have the wmv file and a wave file. I want to add the wave file into wmv file. How can we achive this?
Regards,
Hemant.
|
|
|
|
|
Like I keep telling you. The Windows Media Format SDK is made for this. It's THE SDK for ASF
files, which is what a WMV file is.
|
|
|
|
|
While I can't write it and post it here, maybe I can point you in the right direction.
You'll need to read the video stream(s) (there could be more than one) and write them to to
the new file. At the same time you will read PCM samples from the wave file and write them
to a new, separate audio stream in the new file. For synchronizing audio and video you'll need
to handle the sample time (passed to IWMWriter::WriteSample()) somehow.
It's alot of code to post an example here but there is plenty of sample code in the Windows Media
Format SDK. The "WMVCopy" sample application is a good place to start.
Hope this helps,
Mark
|
|
|
|
|
Hi,
Thanks for your comments!.
Now I am using the Windows Media Format SDK for adding the wave file to wmv file. I have written the following code, but it is not allowing to add audio to me. It adds either audio or video and not the both. WHat may be the reason
public static void AddAudioVideo()
{
try
{
// Create a WMEncoder object.
WMEncoder Encoder = new WMEncoder();
// Retrieve the source group collection.
IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection;
// Add a source group to the collection.
IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1");
// Add a video and audio source to the source group.
IWMEncSource SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud.SetInput("D:\\wmv\\input\\2006_10_16_13_9_49_759.wav", "", "");
IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcVid.SetInput("D:\\wmv\\output\\TestOutPut.wmv", "", "");
// Specify a file object in which to save encoded content.
IWMEncFile File = Encoder.File;
File.LocalFileName = "D:\\wmv\\output\\OutputFile.wmv";
// Choose a profile from the collection.
IWMEncProfileCollection ProColl = Encoder.ProfileCollection;
IWMEncProfile Pro;
for (int i = 0; i < ProColl.Count; i++)
{
Pro = ProColl.Item(i);
if (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)")
{
SrcGrp.set_Profile(Pro);
break;
}
}
// Start the encoding process.
// Wait until the encoding process stops before exiting the application.
Encoder.PrepareToEncode(true);
Encoder.Start();
Console.WriteLine("Press Enter when the file has been encoded.");
Console.ReadLine(); // Press Enter after the file has been encoded.
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
}
///////
}
Regards,
Hemant.
|
|
|
|
|
What language is that code written in?
*shrug*
|
|
|
|
|
|
Hi Guys,
I am currently working on retrieving Computer compoment's data using WMI objects. Everything fine but whenever I try to convert BSTR type to char type I encounter memory violations.
Here is my code:
hr = pclsObj->Get(L"Speed", 0, &vtProp, 0, 0);
char* cap = _com_util::ConvertBSTRToString(vtProp.bstrVal); //Problem occurs here
Return type of the Speed querry is uint32.
If i query Caption which is return type is uint64 there is no access vioalation.
I know topic is very specific, also it may be dicussed hundereds of time.
Yusuf Kabakci
|
|
|
|
|
If the return type is uint32, then why do you think its a BSTR ?
The ConvertBSTRToString() function expects a BSTR and you are passing in a uint32 which is why it crashes.
You need to convert it to a string FIRST, the 'Get()' function will not do this for you, if it did, it would return a BSTR.
Try:
<br />
HRESULT hr = pclsObj->Get(L"Speed", 0, &vtProp, 0, 0);<br />
if(SUCCEEDED(hr))<br />
{<br />
TCHAR szSpeed[20] = {'\0'};<br />
_sprintf(szSpeed, "%l", vtProp.lVal);<br />
}<br />
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
YusufK wrote: char* cap = _com_util::ConvertBSTRToString(vtProp.bstrVal); //Problem occurs here
Return type of the Speed querry is uint32.
reason for crash is that you are converting the long value to String without proper way!
try to check what VT member contain before proceeding ie.
if(vtProp.vt==VT_BSTR)
char* cap = _com_util::ConvertBSTRToString(vtProp.bstrVal); //Problem occurs here
else
ltoa(vtProp.lVal,cap,10);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Hello,
how to change an content of a file?
Ok, i know how to open and read file for changing, now i need to replace one string with a new value!
For example, if the file have only this one sentence:
"Have a good day"
i like to replace the "good" with "nice"! so that the content is now "Have a nice day"
In my solution i read all file content in an CString, than use CString::Replace(csOldString, csNewString)
and write then complete content to the file back!
I mean that is posible to solve this with better solution, maybe without reading all content!
Is there any way to do this different as im described here or is this the common way for this?
regards
break;
|
|
|
|
|
there's no way to "change" the content of a file.
you have to open it, read it, modify what you want in RAM, overwrite it, and close it...
|
|
|
|
|
Hi,
ok, thanx for Answer, so is my guess right!?
regards
break;
|
|
|
|
|
|
Hello WhiteSky,
thank you, that is what i mean, read file -> get content->modify->write back to file!
regards
break;
-- modified at 7:43 Tuesday 31st October, 2006
|
|
|
|
|
|
Hello WhiteSky,
thank you wery much for ask!
I think yes?!
I read my file and store all data in an CString, than to modify that content
use CString::Replace(LPCTSTR csOldString, LPCTSTR csNewString);
In steps looks like this:
1.) Open File in "r" modus
2.) Store Content in CString
3.) Close File
4.) modify Content
5.) Open the same file in "w+" modus!???
6.) Write content back to file
I use fopen() and fprintf() to read and write!
so that my idea?:->
i mean it does what i need, dont know if its the best way, that is the reason
why i ask im comunity!
with best regards
break;
|
|
|
|
|
I think its good because you dont know where's text that you want to replcase
|
|
|
|