|
I would like to create several rectangles overlapping each other but having a transparent look. How can I achieve this by not using bitmaps but regular GDI functions, such as Rectangle(), etc.
Thanks
|
|
|
|
|
Might help: "An application sets the foreground mix mode by using the SetROP2 function and retrieves the current mode by using the GetROP2 function."
These are only for binary raster ops though. Not sure how you would control the mix amount with a setting for alpha blend amount.
|
|
|
|
|
I develop an application (electrical train) where I want to add some sound: a bakground music and some noise depending on my application events.
I used SndPlaySound but it just allow to play .wav file and only one and the same time.
I need to play .mp3 file and add some .wav noises to be more funny
Can someone indicate me which MFC function to use with some exemples.
Thanks a lot....
NKH
|
|
|
|
|
Hello,
The best way for playing .MP3 and .WMA files is DirectShow
There's many libraries on the internet that could do it too.
I'm sure that you can find some samples about playing mp3 files from CP site. ( i saw some good audio players and etc. )
hmm, MCI is another way
Regards,
Hadi
|
|
|
|
|
Hi,
I am writing an application, which does some monitoring work. Here I have to include two buttons and a list box. Now I have to trap the WM_KEYDOWN/ WM_KEYUP messages and scan the contents of the list box. Can provide me some help in this issue?
|
|
|
|
|
Using ClassWizard, select the name of your listbox class in the Class name: combobox. In the Messages list, select WM_KEYDOWN . Click the Add Function button. Do the same thing for the WM_KEYUP message. Populate the message handlers as you need.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi guys
I developed an application in MDI,
I want to know .. i open an new document and close it.. the memory for that document be released...i checked in task manager , it dosent show any release of memory..how shld i find out or wat functions shld i call to release the memory for the document
Thanks
krithika
|
|
|
|
|
TaskManager may not show any change; the memory may be in a heap ready for your app to reuse, but the heap itself has not been shrunk.
The framework will use DeleteContents(), which should clear any member variables in your document.
If you exit, then a debug build will generally show you common memory leaks if you're running under a debugger.
Steve S
|
|
|
|
|
|
Hi everyone !
Is there any way to wait for a callback function like the HookProcs ?
Thanks in advance,
André Schmidt
|
|
|
|
|
Huh?
What do you mean by 'wait for a callback function'?
Do you want an indication when one is called?
(If so, the function could signal an event)
Do you want to wait until a callback has returned?
(doesn't this happen anyway?)
Steve S
|
|
|
|
|
Hi,
is there a simple way to set a PropSheet's background color?
and, how can you set that for a CTabCtrl???
thx
|
|
|
|
|
Hi!
With CreateFromFile() I am able to open an excel file in my ole
container application.
I want to embed excel sheet in my container applicatio and want to
display contents of a file, but i dont want to use CreateFromFile(), I
just want to pass raw data as input.
Which function shall I use,CreateFromClipboard() or CreateFromData().
I am running in Win2k and have office2k.
Thanks
Anshu
|
|
|
|
|
Hello,
I am a beginner in Embedded VC++ programming and am confronted with a problem :
I have a desktop connected to a PDA.I have to write a program to send data from the desktop which would be read and displayed by the PDA.Any suggestions on how to proceed with this is most welcome.
Thanks,
Deepa.
|
|
|
|
|
On the platform end (Windows), the software opens a port, sets the port settings, writes data and closes the port. On the receiving end (PDA), the program must first open the port, then create a listener for incoming data, and when the listener fires an event, read data from the port and close the connection.
Here is a lengthy article digging into the aspects of serial communication quite in-depth. It might be helpful to you: http://www.codeproject.com/system/serial_com.asp[^]
Here is a link to MSDN dictating the Serial Communication on WinCE[^]. I don't know what OS your PDA uses, but perhaps reading it will be helpful.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello Antti,
Thank you for your kind response.My PDA uses Win CE.I have written a program in EVC++ to write a few characters to the COM1 port.Now I have no idea how to implement the read program in the PDA so that it can read the data being sent.
Thanks
Deepa.
|
|
|
|
|
Just follow the implementation guide from Microsoft for Windows CE to develop the application. You must have the port settings made similar. If you readed the first article I posted, a data structure is mentioned there with which you can set the port settings in the Windows end. See the Microsoft WinCE documentation for a respective setting on the PDA end.
I think versions of WinCE sport some type of MFC support, and thus you can use much of the same code to implement port reading on the PDA end. For this purpose, you would need to consult the PDA documentation and/or files to see what version of MFC it supports.
The most effective way is to use the Microsoft-provided WinCE emulator. This allows you to develop and test code on an emulator before sending it to the actual device. I think eVC++ supports on-device debugging through a serial connection. This is not very viable in your case, as you need the serial connection yourself. So use the emulator.
For an example, create the WinCE build, run it in the emulator, then start the Windows-end program, write data into the port and attempt to read it through the emulator. For an extremely effective method, if your computer supports two COM ports, you can write to the first using the Windows-program, then read from the second using the emulator-driven build. Just get a cross-connected serial cable (or build one yourself) to inter-connect the two ports.
Also, you should post this question into the Embedded / Mobile area, as most of the users who develop WinCE software tend to hang around there, and thus you might get more knowledgeable answers.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
I made a service 'SRVANY' of a program i have written in MFC.
This works great using the login of the LocalSystem account.
Now here is the problem:
I'm using the localsystem account because i want to be able to have an interactive program .. The users logs in and can do some actions he want.
Let's say the program needs to write a certain file to a share located '\\ip\d-share\'. The user doesn't have the ability to get access to that share because it is using the LocalSystem account. Then i thought .. Oh i'll use a network account and the problem of the share will be solved. Indeed it was, but this made the program not be interactive with the desktop! And i don't want to loose that .... So i want to combine both advantages.
Is there a way around this or a good solution? The solution needs to work for Windows2000 computers too so not only old Windows NT versions.
I hope someone came across this problem too
Greetings,
JensB
|
|
|
|
|
One way this is often achieved is by having a service that uses any account, LocalSystem, or a specific account if you need network access. The service does not use a GUI, but processes requests received by some IPC mechanism, such as a named pipe or a socket.
The GUI is then run by a user on their desktop, and it communicates via the pipe or socket with the service. If necessary, the service can impersonate the client to acquire their access rights.
Often a socket is used in place of a named pipe because the named pipe needs to be accessible by everyone (generally), and many people don't understand how to construct an ACL to apply to the pipe.
Steve S
|
|
|
|
|
Well, the only reason i want to run a service out of the program is that the program needs to be able to start when the computer boots before the user logs in.
The program itself has a GUI!!
Greetings,
Jens
|
|
|
|
|
i tried the following but somehow the radio buttons do not work accordingly.
UpdateData (TRUE);
if(m_radio=0){
do this...}
if(m_radio=1){
{do this...}
if(m_radio=2){
{do this...}
i have 3 radio buttons grouped together.
|
|
|
|
|
I hope that your
if (m_radio = 0)
is a typo, and you've not forgotten that in C/C++ the test for equality is == ...
Steve S
|
|
|
|
|
As Steve has already indicated, it looks as though you have mistakingly used the assignment operator in place of the equality operator. If you will get in the habit of putting constants on the left side of either operator, the compiler would have gladly complained about these statements.
For example:
if (0 = m_radio)
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How to show AVI file in a CDialog?
(what better way?)
thanks
|
|
|
|
|
use MFC class CAnimationCtrl
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|