|
have you try to generate a release version?
|
|
|
|
|
I tried just now, result is the same.
the project generate a the .exe file, but I need a dll which generate by another project to run with it, and I must set the two project output to the same outputDir.
|
|
|
|
|
Which DLLs are you linking against?
If it's the C library and the MFC library, you can change your linker <edit>settings</edit> to link to them statically, rather than 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"
|
|
|
|
|
the dll I want to link is built by another project of the same solution.
|
|
|
|
|
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
|
|
|
|