|
I want to display a sequence of 10-15 jpeg images in a dialog box with a scroll bar which can move between tha images .I have just started with VC++ and have the faintest idea of what to do .
|
|
|
|
|
Hi guys
Is there a simple way to play a sound that you previously included as a resource?. For only 17Kb it's annoying to have to add a extern wav file to the program.
Best Regards.
Doc
|
|
|
|
|
doctorpi wrote:
There is a simple way to play a sound that you previously included as a resource.
Are you asking or telling? If the former, see if this article is of any help.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Sorry David
I've corrected my question.
Sometimes my english is not as good as needed to understand my questions.
I'm taking a look your article. I think is what I need to have the resource on memory.
But, what about to play a sound?
Thanks
Doc
|
|
|
|
|
In Resource View Right Click On Your Resource Folder
Select "Import"
In The File Types Filter Select All Files Or *.wav If there is
Then Add The File U Want Thats it
Use ::PlaySound(MAKEINTRESOURCE(ID_MYWAVE,m_hwnd,SND_RESORCE|SND_ASYNC/*other parameters if u want to*/);
include the mmsystem.h header file and add the library winmm.lib in the debug and release configurations
I Have A Problem With PlaySound
The Problem I am Having Is when I exit my app the thread created for playsound with the SND_ASYNC returns a value of -1 i know that using ::PlaySound(NULL,0,0) the thread should be terminated safley i tried it but it fails i created a click sound for each mouse click on LButtonDown I use PlaySound with correct params on LButtonUp i use PlaySound(NULL,0,0) but the thread exits with -1 normal terminal should exit with 0
|
|
|
|
|
Thanks you guy.
It works perfectly.
Doc
|
|
|
|
|
Leyusha wrote:
I Have A Problem With PlaySound
The Problem I am Having Is when I exit my app the thread created for playsound with the SND_ASYNC returns a value of -1 i know that using ::PlaySound(NULL,0,0) the thread should be terminated safley i tried it but it fails i created a click sound for each mouse click on LButtonDown I use PlaySound with correct params on LButtonUp i use PlaySound(NULL,0,0) but the thread exits with -1 normal terminal should exit with 0
ANY ONE
|
|
|
|
|
Leyusha wrote:
...normal terminal should exit with 0
Are you sure?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
doctorpi wrote:
Sorry David
I've corrected my question.
Sometimes my english is not as good as needed to understand my questions.
Not a problem. I don't criticize people's speech, either written or verbal, but I will ask for clarification if it is necessary.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am trying to pull specific information from the Security Event Log in windows 2000, in Visual C++ 6 for a auditing system I am creating. Using information from MSDN I have been able to extract the event number, the time it occurred, and the user who triggered the event. The last thing i need is the file that was modified. I know this only applies to certain events. How can i get the file that was accessed/modified/deleted? I have not been able to find a clear example. I've tried using GetEventLogInformation but i was unable to get it to work. I also tried get the message map but I failed at that as well. Are either of these the correct approach? Anyone know of any examples? Any suggestions would be appricated.
|
|
|
|
|
jet9153 wrote:
The last thing i need is the file that was modified.
What file? The event file itself, or a file that an event message refers to?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I configured auditing on a folder on my local hard drive. I want to know what file in that folder was accessed. I see it in Computer Management, when I double click certain events. I want to know how to get that file name from within a C++ application.
|
|
|
|
|
jet9153 wrote:
I want to know what file in that folder was accessed.
Would ReadDirectoryChangesW() or FindFirstChangeNotification() be of any help?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Sorry but no, these functions do not help. I think i need to explain myself better. On my PC i set up auditing on a select folder, "C:\Image_Db". Any time someone looks at one of these files, deletes a file, changes a file, I want to know who did it, at what time, what file, and what they did to the file. The solution i found was to audit these files through windows event logs. Currently i have to manually find the 564 event and then find the corresponding 560 that gives the file name.
I recently discovered a set of API functions that allow for access to the event logs. I am able to get the eventID, the user, the time, but i can not figure out a way to get the file that was accessed. I think the filename is embedded in the EVENTLOGRECORD structure, after StringOffSet, as described in the MSDN website. I want to know how i can get that data out of the structure. I am not sure if this is possible and I have seen no reference to it on the internet. If you can point me in any direction what so ever i would be grateful.
If you know of a better way that i can log all changes made to a file i would like to hear it.
Thank you for all your help thus far.
|
|
|
|
|
jet9153 wrote:
Any time someone looks at one of these files, deletes a file, changes a file, I want to know who did it, at what time, what file, and what they did to the file.
While ReadDirectoryChangesW() or FindFirstChangeNotification() will tell you the file and the operation on it, the other criteria would need something like a file system driver that creates and attaches filter device objects to target file system device objects to see all IRPs and FastIO requests directed at those drives.
When looking at the event, where does the filename show up (e.g., in the Description box)? As you've found, the message itself is not written to the event log, only the event's id. You'll need to use EventID and SourceName to locate the event in the message DLL.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I did...
I don't get confirmation of replys or attachments...
shotgun
|
|
|
|
|
Hello,
I have a Lib which has some objects which are compiled depending on whether certain macros are defined or not. I was wondering if it is possible to have multiple builds of the Lib for the different scenarios and have Visual C++ automatically choose between the correct version of the Lib to use?
Example:
In the Lib:
#ifdef _MACROA
class A
{
.
:
.
};
#endif // defined(_MACROA)
This means that we have two possible versions of the Lib: one for when _MACROA is defined and another for when it's not.
So the question is how to configure the project settings in the (implementation) App - if such a thing is possible at all - to make it choose the correct version of the Lib depending on whether the macro is defined or not.
Perhaps I should adopt a different strategy?
All insights on the question in hand will be greatly appreciated.
David
|
|
|
|
|
You could use a method such as:
#ifdef _DEBUG
#pragma comment(lib,"SomeLibrary_D.lib") <font color=green>// Use debug build of library</font>
#else
#pragma comment(lib,"SomeLibrary.lib") <font color=green>// Use release build of library</font>
#endif
Depending on which build of your program you will be using, these #pragma definitions will use the corresponding build of the dependent dll.
I Dream of Absolute Zero
|
|
|
|
|
You could also always add a new 'configuration'.
The 2 defaults are Win32 Release and Win32 Debug, but you can add others, which allows you to define specific project settings for each one. You can create different output files, use different preprocessor macros, include different libraries, etc.
You you could have
Win32 Release With MacroA
Win32 Release No MacroA
Win32 Debug With MAcroA
Win32 Debug No MAcroA
for example.
On the VC 6.0 'Build' menu there is an item labeled 'Configurations...' that invokes a dialog that allows you to add/remove configurations.
Then, when you want to work on a specific configuration, you use the Build|Set Active Configuraiton... menu item to specifically define the one you are working on.
You can use Build|Batch Build... menu item to make all of them at once.
|
|
|
|
|
Great! That's exactly what I was looking for!
Thank you very much for replying.
David
|
|
|
|
|
You are welcome, glad the information helped.
It is a handy feature to make custom builds of your software for different customers or target audiances.
|
|
|
|
|
Hi
I want to merge several files into one file. How can i do this in Visual C++
In DOS it is very easy, you just use the copy function in a batch file, e.g copy "c:\tstTag3.csv" + "c:\tstTag4.csv" "c:\test.HTML"
Can anyone help me get started with this?
Thanks
Gunnar
|
|
|
|
|
You use the file commands: CreateFile, ReadFile, WriteFile, and CloseHandle functions. The first call creates the output file and opens the first input file. When you are done reading the first input file, close its handle and open the next one. Open each subsequent input file for reading and keep writing to the output file. Close the output file when you are done reading the input files.
|
|
|
|
|
On days like this I feel like a total n00b, even after three years of intensivly using MFC... do a good deed today and help me... pleeeease!
I do have Visual Studio .NET 2003 and plan to make a multi document application with several different views for each document so I can switch on-the-fly between those different views with some buttons on the toolbar.
For achieving this I used the project wizard to generate a multi document Doc/View application with the view derived from CView. So far so good. Now I inserted a new MFC class derived from CFormView and I enabled the checkbox "Create DocTemplate ressources". Afterwards I had a new class, a new dialog in the ressources and in the applications InitInstance() I got this:
CMultiDocTemplate* pNewDocTemplate = new CMultiDocTemplate(
IDR_SOMEFORMVIEW_TMPL,
RUNTIME_CLASS(CTestMultiViewsDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CSomeFormView));
AddDocTemplate(pNewDocTemplate);
When I start my application now I get the following window:
(image link)
Question 1: how do I circumvent this dialog and preselect one of those views?
Question 2: how do I switch between those views during runtime without closing/deleting the document?
Jup, that would be it.
I have already read this Codeproject article and this (quite old) Codeguru article but I do not get it working as I want it to work.
There must be a good and simple solution for this, because my intend isn't that special I think. So please tell me how to do it or where to read more about it.
Thanks & Bye,
Matthias / T.T.H.
|
|
|
|
|
losing the dialog in 1. involves changing the command line passed to the app in initinstance() ... cant remember exactly what but look in msdn and it'll be there
2. switching between views? u mean creating a new view or what exactly? the user switches between them with the mouse
unless u mean a different representation of the same data ... in which case ur OnDraw() handler can do that for you
"there is no spoon" biz stuff about me
|
|
|
|