|
The problem is that messages handled with ON_MESSAGE() (including OnTrayNotify() ) must return an LRESULT , not void . The cast is inside the ON_MESSAGE() macro. Look in the source for the macro to see how it works.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
O.K. - got it sorted !! Thanks for the help Ryan
"Bewildered"
|
|
|
|
|
Hello,
I need to design a dialogue that its shape is changed with the user interface. It is very similar to a tabbed dialogue box but the active propertysheet would be selected by the selection on a tree control. I remember from old times that VB has a container control that I can put several control on it and then when I set the visibility of the container to true, all of my control on that specific container become visible and vice versa. Is there any way that I can do this in VC6? I tried to do this by using CPropertySheet without any success. Any help of code sample appreciated.
Best regards
Dialogue container
|
|
|
|
|
I am using RasEnumConnections function of SDK to get list of active DUN connections. Its working fine under WINXP but under WIN2K it gives error code 632 or 0x278 which is ERROR_INVALID_EA_HANDLE. Can you tell me whats wrong with that. Same application is running on both OS. I have Plateform SDK 2001 installed and SP4 for WIN2K and SP1 for WINXP installed on my machines. I have used the sample sinppet given in MSDN.
Thanx in advance
Asif
|
|
|
|
|
This error might be caused by the RASCONN structure that you pass to the function.
According to the MSDN documentation, the RASCONN structure has a few extra members (dwFlags and luid) under Windows XP. These members are not supported in Windows 2000 environment. I presume that you are building the application on a Windows XP platform, and as such, the structure gets initialized to support all the features in Windows XP. It compiles under Windows XP properly, but will not run on Windows 2000.
In order to fix this, you need to go to your project's settings and into the compiler settings. In there, add an extra predefinition. For a list of definitions to use when specifying the minimum platform, see this[^] list in MSDN.
To support Windows 2000, you must define WINVER to 0x0500. Now when you compile your code, it produces an executable that runs on Windows 2000 and above.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
I would like to write of algorithms WIN32 API.So that , I can understand easily.
Please give me an example of WIN API with algorithms.
Is it possible easy way to write algorithms.?
Please guide me and suggest me which book is useful for this.
Any help appreciated.
Best Regards.
Rajesh
rajesh
|
|
|
|
|
Hmm..
I don't quite understand your question. An algorithm is a set of predefined instructions that solve a specific problem or a problem of specific type. For example, solving an equation can be called an algorithm.
Win32 API, on the other hand, is used to program Microsoft Windows(r) environment, allowing the creating of Windows-compatible software. It has nothing to do with algorithms.
Could be a bit more specific about your problem. What is it that you are needed to do ? Write an algorithm to do something ? Write a Windows-application that does something ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
I have a framegrabber that snaps an image and sends it to a memory buffer at
m_pBuffer (type of LPVOID). I do not know the content structure of the m_pBuffer,
but i know i contains a 24bit RGB Bitmap. Doing the operation below (SetDIBitsToDevice),
allows me to plot the contents to the screen.
I want to transfer the contents of m_pBuffer to my own device context (CDC myDC),
so that i can use GetBitmapBits and manipulate the date prior to plotting on to the screen.
Can anyway point me on how to do this? Do i use SetDIBits, if so, how?
CClientDC dc(this);
if ( m_pBuffer == NULL ) return ;
pBitmapInfoRGB24->bmiHeader.biWidth = ImageSizeX ;
pBitmapInfoRGB24->bmiHeader.biHeight = - ImageSizeY;
// ------------------------------------------------------------------------
// Transfer the image to display
// ------------------------------------------------------------------------
SetDIBitsToDevice ( dc.GetSafeHdc(), 22, 25
, ImageSizeX, ImageSizeY
, 0, 0, 0, ImageSizeY
, &m_pBuffer
, pBitmapInfoRGB24
, DIB_RGB_COLORS);
bOnGoingRefresh = false ;
|
|
|
|
|
Have problem to synchronize between two events:
Grab_Image() ;Grab Image from CCD camera to an image Buffer
Read_Motor_Position() ;read the motor position
It is important to get minimum time between this two commands but sometime the time between the command become very large , as I understand this happened because the operation system ( Windows) "time slicing".
I need a solution to lock the system such this two command will be always execute together without any interference.
Michael Geffen
|
|
|
|
|
Michael geffen wrote:
I need a solution to lock the system such this two command will be always execute together without any interference.
You can't unless you use a third-party real-time extensions program. You can use SetThreadPriority() and SetPriorityClass() to give your thread realtime priority, which will give your application basically all of the CPU time. Just make sure you set the priority back to normal, or else the entire system will hang (even the clock will stop, and the mouse will become unresponsive). But even this doesn't guarantee that there won't be a context-switch in between those commands. There is nothing you can do without third-party extensions to guarantee this. Changing the thread's priority is the closest you'll get.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Actually, you can get just a little bit closer by forcing a contex-switch before the execution of the critical section... You can force a context switch by calling the Sleep api. After this function returns, your thread will start with a brand new timeslice
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
True, but it won't help him. He's doing two I/O operations. Windows will guarantee that his code will be interrupted
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hope dies, dreams shatter, welcome in the world we like to call Windows(r)
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
To add to Ryan's answer, you cannot prevent the system from interrupting your thread, ever. That's how preemptive multitasking works. If you absolutely need realtime control over the CPU time and hardware, then Windows isn't the right OS to be using.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Dear All:
I am involved in a project that contains a module recording TV program into local hard disk.
Does anyone have any idea to Capture video come from TV card?
I have a PCI TV card but I have no idea how to capture video stream and encode into MPEG-II.
Your reply is greatly appreciated.
|
|
|
|
|
The answer is DirectShow.
All modern capture cards feature a DirectShow filter that can supply you with raw video data from the capture card. The properties of the filter determine what else it can do. Some can supply you with still-images, for example.
Capturing video with DirectShow is easy. You need to build a capture filter chain or, as they are also called, a capture graph. Filter chains in DS are a set of filters connected adjaciently that process the video data in a pass-through manner. An example of a capture graph is as follows:
- The video source, in my example, Logitech QuickCam 4000 Pro video capture filter
- The encoding filter, here, the XViD video compressor filter
- A video multiplexer, here, the AVI Mux multiplexing filter
- And the file writer filter.
If you wish to try this out, you can download the DirectX 9.0 SDK. This SDK also contains a VERY handy set of tools, from which the most interesting is GraphEdit . This program allows you to build any kind of filter chains using any filters available on your system. So, if the video card has it's drivers installed properly, you should find it's capture filter, in GraphEdit, from "Graph -> Insert Filters... -> Video Capture Sources -> Your PCI TV Card brand here"
After you have inserted this filter, right-click on it's 'Output' or 'Capture' pin, and select 'Render Pin'. This will automatically build a filter chain that can display a live video feed from the filter in a small window.
In order to learn how to build filter chains, you should consult the DirectX SDK documentation. I myself am in the process of writing an article on video capture, but it won't be ready until after a few or more days.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Dear Antti:
Thank you for your detailed explanation.
I have another question, are these features supported in the Windows CE environment? The project will be developed under Windows CE.net.
Thanks a lot.
Jeffrey Gao
|
|
|
|
|
Looking at the supported list of DirectX filters in Windows CE.Net (Found here[^]), it seems that the DX for WinCE .Net lacks the following filters: AVI Mux and File Writer. Unfortunately the availability of Video Capture filters and video compressors is not defined by this list.
You should download the Windows CE .Net SDK. Another interesting thing might be the .Net Compact Framework. This framework sports some level of support for Managed DirectX as well, but unfortunately I am no proficient with it.
The best way would be to obtain a copy of GraphEdit program (Distributed with DirectX SDK) and get it to run on a Windows CE .Net platform. This program could instantly show you what filters/capture devices are available on the target platform. Basically, you will need the following things:
- A video capture source
- A suitable video compressor
- AVI Multiplexer that creates AVI format videos
- A file writer
The last two, like discussed, are not listed in the online reference. Thus I doubt their availability on the actual device also. But as an alternative, the AVI Multiplexer is just used to create a stream that follows AVI format specification. This can be done manually, but requires exact knowledge of the AVI format. The last, file writer, just writes the stream into a file. It could be done by using any suitable stream-based file writing algorithm (such as an advancing file-pointer), so it is not necessary either.
So, grab a copy of GraphEdit somewhere and get it to run on the Windows CE .Net device. I know this isn't much, but it's a start nevertheless.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
As an alternative to what the other guy said, here are two (linux only?) projects that do this in a much more complex mannor, you might learn something from their code, or find they already meet your needs.
http://freevo.sourceforge.net/
http://www.mythtv.org/
|
|
|
|
|
Dear Henry,
Thank you for your reply.
I will check that out.
Jeffrey Gao
|
|
|
|
|
Please excuse the basicness of this question but I just got to know.
Which Comes First: The C or The C++??
I have heard it both ways:
Learn the basics of C then start C++.
Do not Lean C first you may form bad habits and is a waste of time.
Is it that there is not a definitive answer or that someone just can't decide? I am guessing personal perference??
Thanks
-Mark
We're sorry, we were unable to complete you request. The website administrator has been automatically notified.
That's real reassuring.
|
|
|
|
|
|
What does your boss need you to know? The first concern is always what you need today.
I've known several programers that were excellent at C, but never did figure out C++ despite using C++ for years, they were too stuck in the C world. So from that point, it is better to learn C++ first, in hopes that you learn to think about objects from the start.
|
|
|
|
|
Hello everyone.
I write a video capture programe based MDI using MS driectshow ,the
video is captured from CCD camera, i need to preview the real-time
video ,how can i preview the video at one windows of the MDI program.
can you give me some sample code?
Thank you!
|
|
|
|
|
I know how to preview the video to the windows using its hwnd.but i don't konw how to preview the video to a MDI program.
|
|
|
|