|
|
Good Morning Everyone,
I am using Visual C++ 6.0 MFC. I am writing my first multi-threaded application and I need to be able to use semaphores. In examples that I have looked at they say to declare the semaphore class as CSemaphore cph(1, 2) for example. When I try to declare the semaphore in my class header file the compiler returns with the type of error that you would get if you did not #include a needed header file. Is there a header file that CSemaphore requires to be #included?
Thanks,
Buck
|
|
|
|
|
BuckBrown wrote: Is there a header file that CSemaphore requires to be #included?
They hide that information in the documentation[^]
led mike
|
|
|
|
|
I guess I really don't understand. I read this documentation earlier and thought the idea was something like this -
class CTests : public CWnd
{
// Construction
public:
CTests();
CTemperature* pTemperature;
COutput* pOutput;
CGPIB* pGPIB;
CTabPageSSL* pTabPage;
CSemaphore cph(1, 5);
// Attributes
private:
If I remark out the declaration it compiles fine, if not it does not compile.
Buck
|
|
|
|
|
BuckBrown wrote: I read this documentation earlier
maybe your definition of "reading" is different than mine.
From the documentation:
Requirements
Header: afxmt.h
led mike
|
|
|
|
|
Gee, do I feel stupid now. I was so focused on the body of the document that I didn't even notice the little requirements section. My appologies.
Thanks
|
|
|
|
|
BuckBrown wrote: class CTests : public CWnd
{
// Construction
public:
CTests();
CTemperature* pTemperature;
COutput* pOutput;
CGPIB* pGPIB;
CTabPageSSL* pTabPage;
CSemaphore cph(1, 5);
Doing that in the header file won't compile. The overloaded constructor should be invoked using the constructor of your CTests class:
<code>CTests::CTests() : cph(1, 5) {
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Boy that's the truth. That's why I became a microelectronics engineer in the integrated circuit industry (I help develop the silicon that makes us feel stupid).
Thanks for the input
Buck
|
|
|
|
|
Hello,
I am playing around with a DVD-Video API sample which is parently is available online.
When I compile it, it appears that I am a "X11/Xlib.h" file missing. Can anyone tell me where I can get this file, please?
Thank you...
Khoramdin
|
|
|
|
|
do you really have the Xlib.h file somewhere, because if the compiler doesn't find it, it is either because the file doesn't exist or it's not in his includes...
|
|
|
|
|
Your program is probably from Linux and is using X11 to display its GUI.
You have several options:
Install an X-server on your machine and use it to display your sample program.
Not for the faint of heart.
Convert your program to use another gui.
Much work, but a good exercise.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
If you are referring to the project I made and sent to you then you need to set up your Visual
Studio environment...
Follow these steps first: Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK[^]
Repeat step 3 from that article using the paths to the DirectX SDK include and lib folders. On my
machine they are here:
C:\Program Files\Microsoft DirectX SDK (December 2005)\Lib
C:\Program Files\Microsoft DirectX SDK (December 2005)\Include
You'll also need to add an include-files path to the DirectShow base classes - On my machine it's
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses
I built the DirectShow base classes library and included it in the lib folder of the project.
They are UNICODE builds, one is debug and one is release build.
I test-built the project and it builds/runs so it should work for you once you have VS set up
properly.
If this XLib.h file is a *nix issue I can't help you there - it's a Windows app
Mark
|
|
|
|
|
Hello Mark,
Thanx for the reply. I was trying your stuff when I started to get the error. Funny enough I had downloaded and installed few SDKs but not the "Microsoft Platform SDK for Windows Server 2003 R2". I just thought that has got to do with Server stuff.
I am going to get the Microsoft Platform SDK for Windows Server 2003 R2. Most probably my problem is exactly what you mentioned in your message.
Thanx again,
Khoramdin
|
|
|
|
|
Khoramdin wrote: but not the "Microsoft Platform SDK for Windows Server 2003 R2". I just thought that has got to do with Server stuff.
That's the current version that it supports - It includes backward-compatible info/files for all
previous versions of Windows as well.
You'll want to get it - besides for the latest headers/libraries, it's the most recent
documentation.
Keep in mind also that using VS Express has limitations. There's no resource editor, limited
help files, no MFC, etc. *EDIT* No Spy++
Mark
-- modified at 17:43 Thursday 1st February, 2007
|
|
|
|
|
Hello Mark,
I see your point. I guess I will get the Visual Studio 2005 Professional Edition.
I noticed it has other editions which seems far tooooooo profesional. well, they sound like it at least. What I mean by that is the ones called:
Visual Studio 2005 Team Suite
Visual Studio 2005 Team Foundation Server
Visual Studio 2005 Team Edition for Database Professional
The lis goes on but I decided to stop.
Thanx again for your help, mate.
Khoramdin
|
|
|
|
|
Hi Everybody,
While working on VC++ IDE we always feel pain on configuring VC++ directory settings for a new project which uses various 3rd components or includes various levels of folders as included folders in the project .
I have developed a VC++ Directory Utility which can help a VC++ developer in following ways ::
(1) It works for VC++ 6.0 , 7.1(2003) & 8.0 (2005)
(2) SAVE::You can save the existing settings in a suitable list and use it further. You can save Directory setting for other computer user users and use it for your own purpose.
(3)APPLY :: This will show you all saved list . You can apply the saved Dir Settings for your running IDE.
(4) MERGE :: You can merge two existing settings and work on two projects together.
(5) CONVERT :: You can convert Directory setting for one verion of VC++ to the other .
(6) EDIT :: Edit feature is more enhanced as at one shot you can recursively select all the directories of selected folder . You can even Replace certain text by some other text .
I am keen to know if there already exist such type of Software . IF anybody interested to use this I can send it to him . Please send me a mail for that.
REgards
Avanish
Avanish Kumar
GE IIC, HUDA LANE , S P Road ,
Secunderabad -20003(INDIA)
Avanish.Kumar@ge.com
Kumar.Avanish@yahoo.com
|
|
|
|
|
Why not write up an article for it and post it here on CP. Sharing, not free advertising, is what CP is all about.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
If you like you can submit your article on the codeproject
|
|
|
|
|
Hi !!!
I have created one dialog box ( picture control).I want to change background color of my dialog box.
I did some steps but there is no change..I dont know may be some where i did mistake..
My steps are :-
In the Header file of my Dialog(ga_dwgpv.h),added a CBrush variable ( member variable ). Assuming that i have declared it as such.
CBrush m_brush;
In the OnInitDialog function of my dialog, added this code to create the brush.
m_brush.CreateSolidBrush(RGB(150,50,100));
Handle the WM_CTLCOLOR message in my dialog box and in the OnCtlColor function, added this code.
m_brush.CreateSolidBrush(RGB(150,50,100));
Is this correct ??
There is no error in programme.
Any other method to change backgroung color ??
Thanking you
Shah
|
|
|
|
|
show the whole function. i suspect you to call the base class' function, or not to return the context
|
|
|
|
|
Yeh..This is working now..But problem is This is showing color for whole dialog box but i want to change backgroung color of my Picture control box only..
what should i do ?
Shah
|
|
|
|
|
Shah Satish wrote: I want to change background color of my dialog box.
You seem to almost have it.
just return m_brush from the function.
Maybe this[^] can help you?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks for reply..I want to change color of small box which is reside in my dialog box ( Picture control )..ITs showing me whole dialog box back groung color (not Small box ( picture control).
Any suggestion..How to change Backgroung color of Picture control box ?
Shah
|
|
|
|
|
H
Shah Satish wrote: How to change Backgroung color of Picture control box ?
So, you want to have a picture-control on the dialog, which displays the background color of the dialog?
The same color the dialog is alredy showing? Odd!
What is the picture control to begin with?
A CBitmapButton?
Well your PictureControl probably wants a bitmap, wo create one with the background color brush and set it as bitmap in the control.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Yeh..In my dialog box,There are two small box..One is text control and second one is Picture control..Picture control box is showing preview of my Autocad file(dwg file)..Here Backgroing color is White and Color of the drawing is black..
I changed by your method but here its changinf color of whole dialog box but not Picture control box.
Shah
|
|
|
|