|
I am trying to create a pattern brush from a bitmap and print.
It is fine on the screen, however on the printer shows up as solid
gray (difference in screen and printer resolution).
How to handle this problem?
rj
|
|
|
|
|
Now i have 2 files ,one is .inf file,other is DLL file.but how can I use setup api functions to make a driver installation programme?
My idea is;
1) copy DLL and inf file to system disk.
CopyFile() and SetupCopyOEMInf()
2)use SetupInstallFilesFromInfSection() to change REGEDIT.
However,I have not succeeded.Who have the samples to refer?
Thanks in advance!
study to old!
|
|
|
|
|
i am designing a paintbrush and i want to use texture i have one combobox in which i am showing my texture/images i want to implent it on my second image as a texture. i already include all image in combobox as a texture but now i dont know how to implement it selected images/texture on it plzz any one give me idea how to implement texture on second image or anythink else
syed imran azmat
|
|
|
|
|
... reading "No programming questions in the Lounge".
Marc
Pensieve
Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson
People are just notoriously impossible. --DavidCrow
|
|
|
|
|
Interstate traffic does not yeild to merging traffic from on ramps in every state I have lived it. Yet so many drivers insist on braking and yeilding. It seems that simple concepts are the hardest to grasp. Is it more polite to yeild to one person or to not back-up traffic for hundreds?
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I have a simple MFC program to do FFT. It works fine to read an array of waveform data and does fft and output results.
Now I got a console program consisting a function (subroutine) and a few header files. I want to integrate this console program to MFC. But I found a lots problems to built, such as "unexpected end of file while looking for precompiled header directive."
You may have experience for such integration, please give me some advice on this.
Thanks
|
|
|
|
|
mrby123 wrote: "unexpected end of file while looking for precompiled header directive."
Uncheck "using precompiled librares" option in the project setting.
From you described, there shouldn't be big problems. Post the errors you have got.
Best,
Jun
|
|
|
|
|
Or include stdafx in every implementation file.
You only have to change output methods ( cin, cout, printf etc) to dialogs and messageboxes.
Also, the main() function is no longer needed (..you'll have to rename it and call it when a user presses a button or something)
|
|
|
|
|
I tried to create a simple function that would display values on a progress bar. The compiler is returning:
c:\Documents and Settings\Jon\My Documents\Visual Studio Projects\IAD Practice and Assignment\C++ - Assignment\C++ - Assignment\01 - Primes\Primes\PrimesDlg.cpp(75): error C2228: left of '.SetPos' must have class/struct/union type
Any idea how to set the variable to point to the progress control bar control variable?
Function:
void setProgress(int uLowerBound, int uUpperBound, CProgressCtrl *progCtrlVar)
{ int iCountPrimes = 0;
for (int iCount = uLowerBound; iCount <= uUpperBound; iCount++)
{ if (isPrime(iCount) == true)
{iCountPrimes ++;}
}
progCtrlVar.SetPos(iCountPrimes * 0.1);
}
Calling example:
setProgress(1, 1000, m_Progress1);
Jon
|
|
|
|
|
progCtrlVar is declared as a pointer to a CProgressCtrl. Use
progCtrlVar->SetPos
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
progCtrlVar is a pointer. Calling it's members is done with '->' not '.' (ie: progCtrlVar->SetPos(..) )
rtfm
|
|
|
|
|
eusto wrote: rtfm
And how does that help an obvious beginner who is struggling with the concept of pointers? Pointers are not an easy concept for a beginner to wrap their heads around, why do you think VB and C# are so popular?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
So maybe he should use VB and C#? From a syntax point of view pointer are not that difficult. Knowing when to use them is the tricky part.
|
|
|
|
|
You declare CProgressCtrl *progCtrlVar so you need to use
progCtrlVar->SetPos else you can declare CProgressCtrl progCtrlVar; and then use
progCtrlVar.SetPos <br />
<br />
<font size="2" color="#99ff66"><hr></font><div style="padding: 2px; text-align: left; color: rgba(255, 255, 255, 1); width: 80px"><font size="2" color="#99ff66">whitesky<br />
</font></div><hr>
|
|
|
|
|
I have just added a manifest to my project so that I can get the XP theme. I am having trouble getting the button colors so that my owner-drawn buttons can conform to the theme. I have tried GetThemeSysColor( hTheme, COLOR_BTNFACE ) but it doesn't return the correct value. I'm currently hard-coding (yuk) the RGB values for the button color in it's pressed and unpressed states but most certainly would like to be able to get the value programatically.
any ideas?
cje
cje
|
|
|
|
|
The proper identifier is TMT_BTNFACE, which has a different value than COLOR_BTNFACE.
Also note that button faces in the XP themes may have a gradiant, not a single color. If you want the same look, check out DrawThemeBackground or related functions.
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'm creating a class and trying to create a dynamic array of Prime Numbers. However, the compiler is giving this error:
c:\Documents and Settings\Jon\My Documents\Visual Studio Projects\IAD Practice and Assignment\C++ - Assignment\C++ - Assignment\01 - Primes\Previous Versions\v0.3\Primes\PrimeGen.cpp(39): error C2664: 'CPrimeGen::isPrime' : cannot convert parameter 1 from 'int' to 'int *'
class CPrimeGen
{
public:
CPrimeGen(int iUpperBound);
CPrimeGen(int iUpperBound, int iInterval);
CPrimeGen(int iLowerBound, int iUpperBound, int iInterval);
virtual ~CPrimeGen();
bool isPrime (int iNumber);
bool *PrimeNumber; // array of PrimeNumbers
};
PrimeGen.cpp
CPrimeGen::CPrimeGen(int iUpperBound)
{
int iNoOfIntervals = iUpperBound + 1;
this->PrimeNumber = new bool[iNoOfIntervals];
for (int iIndex = 1; iIndex <= iUpperBound; iIndex++)
{
if (isPrime(iIndex) == true)
{this->PrimeNumber[iIndex] = true;}
else
{this->PrimeNumber[iIndex] = false;}
}
}
CPrimeGen::CPrimeGen(int iUpperBound, int iInterval)
{
int iNoOfIntervals = (iUpperBound / iInterval) + 1;
this->PrimeNumber = new bool[iNoOfIntervals];
for (int iIndex = 1; iIndex <= iUpperBound; iIndex+= iNoOfIntervals)
{
if (isPrime(iIndex) == true)
this->PrimeNumber[iIndex] = true;
else
{this->PrimeNumber[iIndex] = false;}
}
}
CPrimeGen::CPrimeGen(int iLowerBound, int iUpperBound, int iInterval)
{
int iNoOfIntervals = ((iUpperBound - iLowerBound + 1) / iInterval ) + 1;
this->PrimeNumber = new bool[iNoOfIntervals];
for (int iIndex = iLowerBound; iIndex <= iUpperBound; iIndex+= iNoOfIntervals)
{
if (isPrime(iIndex) == true)
this->PrimeNumber[iIndex] = true;
else
{this->PrimeNumber[iIndex] = false;}
}
}
CPrimeGen::~CPrimeGen(void)
{
delete [] PrimeNumber;
}
bool CPrimeGen::isPrime(int iNumber)
{
/* hard-setting prime numbers */
if (iNumber <= 1) return false;
/* Algorithm: Sieve of Erastosthenes*/
int *mPrimeNumber;
mPrimeNumber = new int[iNumber + 1];
int iIndex;
/* initialize values
0: not set
1: prime
2: not-prime
*/
for (iIndex = 0; iIndex <= iNumber; iIndex++)
{mPrimeNumber[iIndex] = 0;}
iIndex = 2;
mPrimeNumber[iIndex] = 1;
for (iIndex = iIndex * iIndex; iIndex <= iNumber; iIndex += 2)
{mPrimeNumber[iIndex] = 2;}
iIndex = 2;
while (iIndex <=iNumber)
{
iIndex++;
// the next unset number is a prime
if (mPrimeNumber[iIndex]==0)
{ mPrimeNumber[iIndex] = 1;
// multiples of iIndex set as non-prime
for (int iInnerIndex = iIndex * 2; iInnerIndex <= iNumber; iInnerIndex += iIndex)
{mPrimeNumber[iInnerIndex] = 2;}}
}
// set return value
switch (mPrimeNumber[iNumber])
{ case 1:
{
delete [] mPrimeNumber;
return true;
break;
}
case 2:
{
delete [] mPrimeNumber;
return false;
break;
}
}
};
Jon
|
|
|
|
|
I just compiled this code without any compiler or link errors
cje
|
|
|
|
|
To address your problem, check to make sure your header file doesn't have it declared as:
bool CPrimeGen::isPrime(int* iNumber) .
Everything else looks okay from a warning/error point of view.
Some things you might want to consider:
Instead of storying true/false for each integer index, you might want to use a vector<long> or a CDWordArray to just story values that are prime numbers. Allowing a class that already handles memory allocation to store your array is less likely to introduce memory leaks and logic errors in your code (and makes it far less lines of code). Storing just the prime integers allows you to decrease your memory footprint when searching for prime numbers in a large range.
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
|
|
|
|
|
Which line has this error?
whitesky
|
|
|
|
|
Can I open solution in created in VS2005 professional in VS2005 Team Developer is any migration or any know issues going?
|
|
|
|
|
Do you mean Visual Stuio Team System (VSTS)? Visual Studio.NET is the majort part of VSTS. Besides, VSTS also incorporated project management, source control, bug reporting and so on.
Best,
Jun
|
|
|
|
|
Imagine I created my project in VS2005 professional at the moment when Team Edition wasn't released yet. Now I got Team Developer if I open solution/project in Team developer created in VS2005Prof is it going to migrate project or no migration needed?
|
|
|
|
|
No migration to your Visual Studio.NET projects. The Team System uses the very same VC++.NET as its compiler. Of course, you need to set up Team System, such as Microsoft Fundation Server. But this has nothing to do with project migration. Project migration is only required when your compiler is upgraded, such as VC6 to VC7 to VC8.
Best,
Jun
|
|
|
|
|
Thanks. Any tips convering projects fom VC6 -> VC8
|
|
|
|