|
|
If you can afford declaring it as static , I think that'd solve the problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
If i decalre my function as static, then i cannot export it, then the InstallShield will not be able to find my function and read it. I guess my problem is when the value is returned to InstallShield. Can you please explain to me more why you suggested the static function? may be i am missing a something here?
|
|
|
|
|
If I'm not wrong, your function is not a stand alone function, but rather a member function of a class of yours named CApp . Then, declaring it as static does not have the same meaning as with a stand alone function, it merely says that this member function can be called without bounding to any instance of CApp . Try modifying your .h like this:
class CApp{
...
static long WINAPI SetFunction();
...); and do not make any other change: this should fix the problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes, my function is not a stand alone function, it is a member function of a class. I tried to declare it the way you told me but it didn't work either
I am thinking that may be i built the DLL in a wrong way? My DLL was built using MFC App Wizard (Dynamic DLL). Can you advice me if what I did is wrong or what type of DLL I should use?
Thank you.
|
|
|
|
|
Dynamic MFC linking... Check MSDN article HOWTO: Properly Export Functions Using the MFC Shared Library (Q140850).
Apart from this, rest asured that an MFC DLL can be called from InstallShield (hey, I did it ). I'd need some code snippets to be able to tell you more about your problem (if the AFX_MANAGE_STATE didn't fix it).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to make flat-toolbar,like office 2000 or VC++,etc.
I downloaded many Flat Tool-Bar sample.But Enyone use CToolbarEx.I want to use it easily,I don't want to spend 'Looking'.
Please tell me better source.
|
|
|
|
|
I have a web page displayed in a CWebBrowser2 control. The print the contents of the web page is use ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL); . This displays the standard print dialog window and allows the user to select the printer to print with. If I use OLECMDEXECOPT_DONTPROMPTUSER the default printer is used.
I'd like to specify which printer to print to without displaying the default print dialog window. Can I use the last two ExecWB parmeters perhaps?
Anyone got any ideas please?
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Hello,
I'm trying to query whether the PC has a soundcard or not. I #include <mmsystem.h>, and I try to use waveOutGetNumDevs(), but I get the following linker error.
MainFrm.obj : error LNK2001: unresolved external symbol __imp__waveOutGetNumDevs@0
Debug/Clockster.exe : fatal error LNK1120: 1 unresolved externals
What am I missing? Thanks in advance.
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
do you link to the "Winmm.lib" ?
Project Settings / Linker and add that library to the list..
i have not used this function ever before.. but i think this should work
bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Add this to your stdafx.h
#pragma comment(lib, "winmm")
- God bless the World
|
|
|
|
|
Gentlemen,
Thank you for the solutions. I went Ernest's so that I can keep it in the source files. Have a good one...
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
I'm trying to make a model rocket simulation where the user can selection file>options from the menu, enter in the rocket data and I'll display a simulation of the rocket flying in the air.
I have the dialog box get the data, I have the functions to do the actual simulation, now I just need to know how to get that data from the dialog box once the user hits OK and then draw the results (I know about the draw functions using dc, but not how to properly implement them in this case).
Also, I have three functions which I use for the simulation, what class should I make them a part of (one does the math, other draws and the third calls the other two).
ie.
void doSimulation()
{
//get data (gravity, mass, etc) from dialog box
for (i=0;i
|
|
|
|
|
Maybe MFC sample Fire can help you. This is dialog-based application with lot of controls and dynamically created image. User changes fire parameters and program redraws the image according to them. You can use this fire for your rocket...
|
|
|
|
|
Just an inquiry...
How do I implement my program so that if I made it an executable file, it's possible to pass "arguments/parameters" to the executable file when it is called...
i.e.
if I made my BOOk Program as an executable file
and I want my executable file of the Book program to accept video file parameters, how do I do this?
In analogy, if i want to open the realplayer.Exe, i command a SHELLEXECUTE with the *.rm file as paramenter and the realplayer automatically opens it.
Thanks in Advance. Best Wishes to all.
|
|
|
|
|
pass the parameters on the command line:
c:\> MyApp.EXE file.ext
in your app, use one of the many command line parsers available here to grab the parameters and act accordingly.
-c
Smaller Animals Software, Inc.
|
|
|
|
|
Sorry, u might have misunderstood my question 'cuz it seems a little bit confusing...
to clarify: I'll set an example.
I have two programs: "X" and "Y" program.
-I programmed X to process video files. then convert it to executable file
-I have another program Y which calls this executable file of X (X.exe) with a VIDEO FILE parameter possibly using the command
ShellExecute (hwnd, "open", "X.exe", [Video File PathName], [Directory of Executable File], SW_SHOWNORMAL);
so the question is, how do i Program X so that it can accept the VIDEO FILE parameter of Y. and open it afterwards.
Y ---video file ---> X.exe
Thanks in Advance...
|
|
|
|
|
The command line parameters can be used in the InitInstance() of
your application. The command line is stored in m_lpCmdLine which is
a char array. If you pass your parameter with a slash (ie. /MYPARM)
they will be considered flags. If you don't include the slash the first
parameter will be considered to be the file you want to open. You can
turn off that behavior my setting:
cmdIndo.mShellCommand = CCommandLineInfo::FileNew;
but why not just include the slash?
*NOTE you can test your command line parameter in the developer studio!
see the PROJECT - SETTINGS - DEBUG(tab)
I usually deal with the command line in my applications InitInstance() just before:
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
|
|
|
|
|
Thanks a lot .. I'll try to implement your suggestion.
|
|
|
|
|
Hi,
Does anyone know how to go about programatically enumerating the network server dns name etc, on a mapped dive under NT?
Say I have a drive H:\ I can see that the server path is 'trtdatasrv\data' in Explorer.
I have a database for cataloging files, but need to know if the user is pointing to the same H drive as well as others, and if not map to it.
Thanks,
Giles
|
|
|
|
|
Hi Giles:
You need to use the Distributed File System (Dfs) Functions....
Start with NetDfsEnum and you will can find other functions that will can help you... ;););););););)
Best Regrards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi Folks!
I'm trying to print a CDialog to a printer CDC. Without any scale conversion, it's way to small. So I use the CWnd::Print function to draw to a bitmap, and StretchBlt() it onto the printerDC. It works, but the resolution of the text is horrible. How can I get a CDialog to print at a higher resolution?
If it's not too stupid a question, I'd be grateful for some help.
Jonnie
|
|
|
|
|
Printer page has more pixels than dialog, I guess your problem is not resolution but pixelization. Try to make smooth magnification using SetStretchBltMode.
|
|
|
|
|
Thanks. Doesn't seem to be the solution though. Isn't it possible to pass the CDialog a device context with a higher resolution, and get it to draw it (avoiding the rasterization which occurs when stretching)?
Jonnie
|
|
|
|
|
I'm having problems using qsort on a CArray of pointers. I've read the CP article 'Using qsort on arrays of sequential data' but this doesn't sort pointers - it only mentions having to do a second level of casting when sorting pointers.
Here's a simplified version of what I'm doing:
header file
===========
// data to be sorted
class CFundData
{
public:
CFundData() {}
virtual ~CFundData() {}
CString m_sFundId;
CString m_sFundName;
};
// array of CFundData*
typedef CArray<CFundData*, CFundData*> CFundDataPtrArray;
// sorting functions
typedef int (*QSORT_FUNC_T)(const void*, const void*);
void SortFundData(CFundDataPtrArray& arrayFundData);
int __cdecl CompareFundData(const void* elem1, const void* elem2);
implementation file
===================
void Foo()
{
// array of CFundData*
CFundDataPtrArray arrayFundData;
// populate array with data
CFundData* pFD = NULL;
pFD = new CFundData; pFD->m_sFundId = "S100"; pFD->m_sFundName = "GHI";
arrayFundData.Add(pFD);
pFD = new CFundData; pFD->m_sFundId = "S200"; pFD->m_sFundName = "ABC";
arrayFundData.Add(pFD);
pFD = new CFundData; pFD->m_sFundId = "S300"; pFD->m_sFundName = "DEF";
arrayFundData.Add(pFD);
// sort the array
SortFundData(arrayFundData);
}
void SortFundData(CFundDataPtrArray& arrayFundData)
{
// sort array using qsort and the comparison
// function CompareFundData
if (arrayFundData.GetSize() > 0)
{
qsort((void*)arrayFundData[0], (size_t)arrayFundData.GetSize(),
sizeof(CFundData*), (QSORT_FUNC_T)CompareFundData);
}
}
int CompareFundData(const void* elem1, const void* elem2)
{
// comparision function to sort by FundName
CFundData* pFD1 = (CFundData*)elem1; // 'bad' first time called
CFundData* pFD2 = (CFundData*)elem2; // 'good' first time called
return pFD1->m_sFundName.Compare(pFD2->m_sFundName);
}
The first time CompareFundData is called pFD2 is ok (it's the first item in the array) but although pFD1 'looks' like the second item in the array, it is not a valid CFundData object.
I know I should probably be using the STL, but I don't want to bring it into the app for this 'simple' sort. Can anyone help?
Gavin
|
|
|
|