|
I'm developing an app in VC6 & MFC where I'd like to ship multiple versions of the software utilizing the same base source code. By multiple versions, I mean two variations of the same application. One version will be like a "Basic" version and another will be an "Advanced" version. So basically the same idea as Windows 2000 Pro and Windows 2000 Server. Both pieces of software utilize the same base code, generally speaking, but have different features available.
I'm looking for ideas, methodologies, approaches, design, etc. on how to implement this. Is the only answer preprocessor directives? What about some type of plug-in approach? The result needs to be able to modify the UI (menu bar, menu items, etc.) I've done a little research on the web but haven't found a "clean" approach to this problem. Help! Thanks
|
|
|
|
|
My article may be of use:
Plug-in architecture for MFC[^]
sounds to be what you need.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm using the DeleteFile Function in an attempt to delete the program that is running. How can a program delete itself? I tried renaming the executable before deleting it, and it does is rename it but doesn't delete it. I suspect you can't delete an open file or program in NT, but I'm sure someone here has found a way to make a program delete itself aka uninstaller..
Any help would be thouroughly appreciated. Thanks in advance friends!
|
|
|
|
|
The easiest way is to create a batch file (.bat), from your program, start the batch file and exit your program.
In the batch file you loop until you can delete the programfile, and you delete the batch file (it can delete itself, a running program can not)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
Consider this function
copyString(char *dest , char *source)
The minimal code to perform this copy is
copyString(char *dest , char *source) <br />
{<br />
while(*dest++=*source++);<br />
}
which can also be written as
copyString(char *dest , char *source) <br />
{<br />
while((*dest++=*source++)!=0);<br />
}
Now consider two strings
dest = <undefined>;<br />
source="sensibleString\0...garbage;
How does the while loop override the asignment operator = and copy only till the source is '\0';
My question is that I need a reason for the loop not to be running infinetely
Doesn't the while loop keep running till the assignment succeeds ? i.e how are garbage values after '\0' not being copied into source ?
Please help me solve this doubt !
|
|
|
|
|
act_x wrote:
How does the while loop override the asignment operator = and copy only till the source is '\0';
it doesn't.
in C/C++, the 'result' of an assignment is equal to the right side of the assignment.
in other words:
int a,b,c;
a = 5;
b = 10;
c = a = b;
so, the loop runs until the 'result' of the assignment is 0.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Remove the ";" at the end of the line of the while loop. There is not ";" after a loop.
while((*dest++=*source++)!=0)
{}
What do you have "0" instead of "\0" in the while loop?
while((*dest++=*source++)!= "\0")
{}
Kuphryn
|
|
|
|
|
Hi All, wondering if someone could take a look at the following program and give me any hints/insight as to why I can't get the appropriate amount of asterisks to print above each number.
This program rolls two dice and is supposed to calculate the number of rolls for each number 2-12, and show that in a histogram.
Any suggestions? THANK YOU for any help!
<br />
#include <iostream><br />
<br />
using std::cout;<br />
using std::cin;<br />
using std::endl;<br />
<br />
#include <iomanip><br />
using std::setw;<br />
<br />
#include <ctime><br />
<br />
const int arraySize = 13;<br />
const int maxRolls = 50;<br />
<br />
int maximum (int [], int);<br />
int histogram(int [] [arraySize], int [], int, int);<br />
<br />
int main()<br />
{<br />
srand(time(0));<br />
int face, max, frequency[arraySize] = {0};<br />
<br />
for (int i = 0; i < maxRolls; i++) <br />
++frequency[(1 + rand() % 6) + (1 + rand() % 6)];
<br />
cout << "Below shows random results of rolling a pair of die 50 times" << endl;<br />
cout << "along with the number of times each number (2-12) was rolled." << endl;<br />
<br />
max = maximum (frequency, arraySize);<br />
int table [maxRolls] [arraySize] = {0};<br />
histogram (table, frequency, max, arraySize);<br />
<br />
for (face = 2; face < arraySize; face++)<br />
cout << setw(4) << face << " ";<br />
cout << endl << endl;<br />
<br />
return 0;<br />
}<br />
<br />
int maximum (int x[], int size)<br />
{<br />
int swap;<br />
<br />
for (int i = 0; i < (size-1); i++) <br />
<br />
for (int j = 0; j < (size-1); j++) <br />
<br />
if (x[j] > x[j+1]) <br />
{<br />
swap = x[j];<br />
x[j] = x[j+1];<br />
x[j+1] = swap;<br />
}<br />
<br />
return x[size-1];<br />
}<br />
<br />
int histogram (int y[] [arraySize], int frequency [], int max, int size)<br />
{<br />
int start = maxRolls - max;<br />
<br />
for (int i = start; i < maxRolls; i++)<br />
<br />
for (int j = 0; j < size; j++)<br />
<br />
if (frequency [j+2] <= max)<br />
cout << y[i][j] << setw(4) << "*";<br />
<br />
else<br />
cout << y[i][j] << setw(4) << " ";<br />
<br />
cout << endl;<br />
<br />
return 0;<br />
}<br />
Sheshi
|
|
|
|
|
Sheshi wrote:
for (int i = 0; i < maxRolls; i++)
++frequency[(1 + rand() % 6) + (1 + rand() % 6)]; //generates all rolls, places data in array
This looks like homework, however I would assume you want to do something like:
++frequency[i] = (1 + rand() % 6);
b/c with what you typed, your not storing anything within the array.
-Nick Parker
|
|
|
|
|
Three things:
- Your maximum function sorts the array passed in, totally destroying your data.
- You initialize your table array to all zero, and never add anything to it. What's the use of that?
- in your histogram function, you have if (frequency [j+2] <= max) . This line will *always* be true.
Your basic logic here is flawed. You initialize the frequency array just fine, but you are messing up your data and display code.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Not really sure where this should go but I thought I'd ask here first. Does anyone know how I can make an installer for my IE Deskband (Toolbar)?? All I have to do is compile the code and it automatically works on my computer but how do I make it install onto another person's computer? Thanks for any help.
|
|
|
|
|
regsvr32 [dll name]
many installation tools have an option to autoamtically register ( call DllRegisterServer ) of dlls included in the install package.
to remove the toolbar you need to call DllUnregisterServer. for example by using regsvr32 again with the /u parameter.
|
|
|
|
|
Visual Studio Installer is a good free setup creator program. It builds Windows Installer files (*.msi) and automates some of the more complex parts.
It is available from Microsoft at:
http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/default.asp
Do unto others as you would have them do unto you - Jesus
An eye for an eye only makes the whole world blind - Mahatma Gandhi
|
|
|
|
|
hi programming freaks,
i make a win32 header and related cpp classes and make a dll .Ok.
now when i want to use the dll in other application i include headers and i think everything is ok ,but visual stadio.net throw me a LNK2019 fatal error.
i don't know what's wrong .
thank u in advance .
please give me a clue!
|
|
|
|
|
rzitman@yahoo.com wrote:
i don't know what's wrong .
Are you working under a managed environment with VS.NET? If so you need to use P/Invoke.
-Nick Parker
|
|
|
|
|
no ,look i use win32 projects .
u know my problem is that my newly made dll isn't loaded in my program properly .
compiler throw me some fatal errors like i can't find the dll .
in a nutshel:
my DLL makeing project :
neededheader.h
relativecpp.cpp
madeDLL.dll
now my test project:
neededheader.h
madeDLL.dll
testcpp.cpp
-----------------
Nick could u shed me a light in this issue?
|
|
|
|
|
When you build a DLL you also get an import LIB file that contains the functions and data exported from the DLL. The other app needs to link with that LIB so it knows which DLL contains the functions/data.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Hi:
I'm working on custom editbox activex control but i have two problems!
1)
i have read a lot of articles in MSDN about changing the BackColor
and TextColor of an edit box through the "WM_CTLCOLOR" message
"""OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)""".But i couldn't use them
in my project to change the BackColor and TextColor of editbox.in the other hand
the mentioned function doesn't work in Activex projects!!!.i have tested frequently.
2)
in some conditions i need to have an editbox with Right-To-Left
reading order so i useed following code to do this:
void CMyEditBoxCtrl::PreSubclassWindow()
{
// TODO: Add your specialized code here and/or call the base class
COleControl::PreSubclassWindow();
ModifyStyle(0,ES_RIGHT);
}
But as you know this is in design mode and....how can i swith between two styles(ES_RIGHT and ES_LEFT) at RUN-TIME ???
this is very important for me.
a beginner in activex programming.
Regards.
|
|
|
|
|
Is there a way to find out which ports are open on the local machine and is there a way of opening and closing ports?
|
|
|
|
|
Hi,
What i am trying to do is to create my own color palette with values that i set...for example:
Red will be 00000001
Blue will be 00000011
and so on....
so at the end i can have a BMP or JPG picture created by a binary data that i created...
Is that possible ? anyone knows ?
thank you for your time
-mario
|
|
|
|
|
im looking for an easy way of changing the background of the dialog window to
some tiled bmp image and also replacing the standard button with a bmp
please help me .
|
|
|
|
|
|
I dont want to use any derived classes.
|
|
|
|
|
Take a look on http://www.codeproject.com/cpp/cppforumfaq.asp#ui_bkcolor
Daniel
---------------------------
Never change a running system!
|
|
|
|