|
The only reasonable way you can include it in your executable is to build it as a static library rather than a DLL, and link to it statically instead of dynamically.
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"
|
|
|
|
|
Do you mean I should use dllimport statements in my source?
|
|
|
|
|
Huh? No. Recompile your DLL as a static library - change its project settings to compile as a static library rather than a DLL.
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"
|
|
|
|
|
Hi All,
currently i am developing an application for audio playback, including local and online resources. I planned to use WMP SDK to help, however, one of my function needs me to be able to select/change the default audio device, however, it is not support by the SDK. I would like to know is there any other method to do so?
(just like Skype/WMP itself hae similar function)
thanks a lot~
|
|
|
|
|
You have to change the values of the following registry keys...
HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper\...
Set value for Playback
Set value for Record
Nibu thomas
Software Developer
|
|
|
|
|
Thanks for you reply, however, i use regedit and cannot locate the key you mention.... any suggestion?
thanks
|
|
|
|
|
I have it and you should also have it. Please check again.
Nibu thomas
Software Developer
|
|
|
|
|
i have tried to export the registry and check but still fail to found...it sounds strange ..
|
|
|
|
|
Quite strange. You should be having one.
BTW what's the need for exporting registry.
Nibu thomas
Software Developer
|
|
|
|
|
Just export to search in UltraEdit for confirm issue ^^
Really thanks for your help ^^
|
|
|
|
|
i was wondering if it would be possible to load a bitmap image into a dialog-based application, to be displayed like a logo for a window and if so, possibly how i would go about doing so.
|
|
|
|
|
go to the top (of most) CodeProject pages, key 'bitmap' into the search field, Set the selector to 'Articles', press the Enter Key
you should see quite a few articles on bitmaps etc - find the one that most suits your needs and experiment with it
when you have an issue, post back a specific question with some code, rather than a 'help me' or 'please help' ..
|
|
|
|
|
Here's one way (I assume you want to load from a file):
1. Add a picture control to the dialog, be sure to set its type to "bitmap". Change to ID to something meaningful.
2. Using the ClassWizard add a member variable of type CStatic for the control, call it m_Picture .
3. Add the following to your class declaration:
HBITMAP m_hBM;
4. Add the following code to the dialog's OnInitDialog handler:
HBITMAP m_hBM = reinterpret_cast<HBITMAP>(
LoadImage(
NULL,
_T("C:\\130x130.bmp"),
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE
)
);
m_Picture.SetBitmap(m_hBM);
5. Add the following in a WM_DESTROY handler:
DeleteObject(m_hBM);
Steve
|
|
|
|
|
:-DHi,
In my project, I need code such as:
one head file:
#include "B.h"
class CA {
void fun(CB *pB);
}
Another head file:
#include "A.h"
class CB {
void fun2(CA *pA);
}
but the including each other will cause compiler error, How to solve that?
thanks.
|
|
|
|
|
1) First of all youll notice that most C++ header files have something like the following in them
This at the top of the file.
#if !defined(AFX_DEFINE_H__CE391361_8C35_11D5_AFA0_00D009BE05B6__INCLUDED_)
#define AFX_DEFINE_H__CE391361_8C35_11D5_AFA0_00D009BE05B6__INCLUDED_
and this at the bottom
#endif // !defined(AFX_DEFINE_H__CE391361_8C35_11D5_AFA0_00D009BE05B6__INCLUDED_)
This prevents the compiler from processing the declarations twice.
2) When you need class A to know about class B and class B to know about class A you can do this:
In my project, I need code such as:
one head file:
class CB;
class CA {
void fun(CB *pB);
}
Another head file:
class CA;
class CB {
void fun2(CA *pA);
}
to avoid the necesity for including the headers with the full class definitions.
|
|
|
|
|
Hi,
In my project, I need code such as:
one head file:
#include "B.h"
class CA {
void fun(CB *pB);
}
Another head file:
#include "A.h"
class CB {
void fun2(CA *pA);
}
but the including each other will cause compiler error, How to solve that?
thanks.
|
|
|
|
|
You don't need to include the headers, just define the class'.
i.e.
// File: CA.h
class CB;
class CA {
void fun(CB *pB);
}
// File: CB.h
class CA;
class CB {
void fun2(CA *pA);
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thanks a lot.it really helped
|
|
|
|
|
In addition to doing the above suggestion, add #pragma once to the top of your headers.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I am trying to compile a project written in Visual C++ 6 in Visual Studio 2005.
And I have an error, saying
error C2664: 'localtime' : cannot convert parameter 1 from 'long *' to 'const time_t *'
Below is the snippet of the file
long totalSeconds = (long)(dSeconds +.5);
struct tm *myTime = localtime(&totalSeconds);//Convert to local tim
Anybody can help me?
Yonggoo
|
|
|
|
|
Short answer:
The prototype for localtime is:
struct tm *localtime(const time_t *timer);
You are passing a long* not a time_t*.
Longer answer:
time_t is a long in 32-bit OS's but a __int64 in 64-bit OS's.
As time_t has been a long for a long time (no pun intended) many developers found it more convenient to just use a long.
In VS2005 time_t is a __int64 unless _USE_32BIT_TIME_T is defined.
So, in reality you are passing a long* to a function expecting a __int64*.
Just use time_t, there is a reason it is defined as a distinct type.
e.g.
time_t totalSeconds = (time_t)(dSeconds +.5);
struct tm *myTime = localtime(&totalSeconds);
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Anyone recommend a profiler that will work with unmanaged C++/VS 2005?
Compuware seems to have bailed out on releasing the free community edition that was available for 2002/2003.
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
|
|
|
|
|
Unfortunately, Compuware doesn't have a free version since their latest version is really nice.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have an app written in VC++ 6.0 on XP Sp2. The app makes a socket connection to a service under normal conditions. If the service is stopped the app destroys the socket, recreates a new one and retries. The deletion, recreation, reconnect continues until successful.
However, I notice that there is an apparent memory leak. I've checked out
Process/Private Bytes & Process/Working Set using Perfmon. Both are seen to
increase during the reconnection attempts.
Any ideas please.
Dave Regan
|
|
|
|
|
Visual C++ 6.0
I've setup some context-sensitive help functionality for our app. The target window is a CView with a bunch of embedded CWnd objects. When I click on the context-help button in the toolbar, the cursor changes to the arrow/questionmark (like it should). However, if I click somewhere in the view that isn't one of the smaller CWnd's, I have the program displaying a messagebox saying there's no help. Now comes the weird part...
When I click the okay button in the messagebox, the cursor doesn't change back to the standard arrow cursor until I move the mouse over another window.
I've tried this line of code at the end of my OnContextHelp function:
AfxGetApp()->LoadStandardCursor(IDC_ARROW);
but it still doesn't change the cursor. Anyone have any ideas?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|