|
where i can get manual or tutorial or sample for ms dbgrid control in visual c++?? can someone helpme plz ...
|
|
|
|
|
ive got this program im trying to write and basically its supposed to get an integer and decide if its prime or not prime.
the problem is, i have no idea where to start. i know it involves things like while loops but im not sure how to get it to determine if its prime or not.
can aanybody help?
|
|
|
|
|
Anonymous wrote:
the problem is, i have no idea where to start. i know it involves things like while loops but im not sure how to get it to determine if its prime or not.
Small Logic:-
void main()
{
int i,j;
bool bPrime=true;
cout<<"enter the number ( greater and equal to 2 ) : ";
cin>>i;
for(j=2;j<i-1;j++)
{
if(i%j==0)
{
bPrime=false;
break;
}
}
if(bPrime)
cout<<endl<<i<<" Number is prime";
else
cout<<endl<<i<<" Number isnot prime";
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
A prime number, by definition, is divisible only by 1 and itself. Your program finds an integer that, multiplied by itself, is equal to the user's number.
Software Zen: delete this;
|
|
|
|
|
First you have to know what a prime number is. The rest is just symantics here.
In other words, write some code and post it with your question. The odds are that while you are writing it, you'll get your see answer.
INTP
Every thing is relative...
|
|
|
|
|
I want to have an array of objects for an object horse.
horse oHorse[3];
horse Jabo;
horse DarbyDan;
horse BigRed;
How would I set a horse named Jabo using the array?
I've tried oHorse[0] Jabo; but I get that Jabo is an undeclared identifier. I'm a newb so please explain any concepts if you feel they need explained.
Thanks
|
|
|
|
|
Anonymous wrote:
How would I set a horse named Jabo using the array?
what do you mean by "name" ? does the horse object have a name member variable ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
No, Jabo, BigRed would be the name of the horse object itself. horse BigRed; is a horse named BigRed. From there I could say BigRed.ShowStatistics();
Thanks
|
|
|
|
|
Instead of set I meant declare, sorry.
|
|
|
|
|
i still don't know exactly what it is you're trying to do... but, it sounds like you want an array where eac element in the array has a unique variable name. ... ?
if that's true, then you can do it in a couple of ways. here is the basic code:
horse horsearray[3];
horsearray[1].SomeMemberFunction(...whatever...);
if you want to give them names, in a way, you can do something like this:
enum {Jabo = 0, DarbyDan = 1, BigRed = 2};
horse horsearray[3];
horsearray[DarbyDan].SomeMemberFunction(...whatever...);
or, if you want to make your code confusing:
horse horsearray[3];
horse *Jabo = &horsearray[0];
horse *DarbyDan = &horsearray[1];
horse *BigRed = &horsearray[2];
DarbyDan->SomeMemberFunction(...whatever...);
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
No, I think you understand what I asked now. I will give it a try later, and if I run into any problems I will post back. I don't want to make it confusing as I'm a newb .
Thanks
|
|
|
|
|
Hi everyone,
Not sure if it's a right place for my question, although it's about C++;
Does anyone experienced any troubles with running code that uses CInternetSession on a computer with ZoneAlarm installed? I can't even run examples like Tear and FteTree from VC! It simply gives timeout.
Looks like ZoneAlarm blocks inet access for those apps without even asking permission.
All other apps (commercial or freeware) work as intended. When they try to connect, ZoneAlarm asks if I want to block access or not. But when I build code with CInternetSession in it, including examples from some articles here, on CodeProject, it blocks access without asking.
Is there a solution known for that problem?
|
|
|
|
|
Is Multiple version of a sinlge dll for each language possible?
Jim456
|
|
|
|
|
You can either put multiple resource languages in a signle DLL or make a separate DLL for each language. Usually the language code will be appended to name of DLL and you explicitly load appropriate language DLL at runtime. If you use all special resource loading functions that accept the language identifier, then it might be easier to combine all the languages into a single DLL. You can not have multiple copies of the 'same' DLL on the system, they have to differ at least by name.
|
|
|
|
|
This sounds very basic but, why cant the dll have like multiples copies on the system?
Jim456
|
|
|
|
|
Hello,
I need to write a program that receives video data sent by a camera (custom made, not an internet camera) using udp or tcp (which is prefered ?)
btw, the camera is connected directly to the computer without network sharing (no switches or hubs or firewalls).
The camera send the data with 50 frames per second and the image size is 480*384 16 bits per pixel. I need help with the implementation of a program that will receive all the frames display and save them to a binary file.
It has to be deterministic (50 frames per sec) (all the data should be saved, no data loss)
I have to display the data at the same rate.
I rather use win32 or mfc.
The hardware i am using is:
1. custom made camera sending video data using udp
2. Gbit Ethernet card
3. pentium 4 (3ghz, 1gb ram)
Thanks.
|
|
|
|
|
The samples that come with the download are for VB and C#; nothing for VC7.
Don't even bother asking the company for answers, you'll get none (if you're ever lucky to get a reply). And if you're lucky to get a reply, you'll learn that there are no VC++ API's to interface with the database. IOW, you're on your own. The product does not even come with ODBC drivers.
I've pretty much had to do and create everything myself when it comes to having the product interface with VC++ for ".net'.
Whatever you learn from their website about technical support, it's for VB and C#.
William
Fortes in fide et opere!
|
|
|
|
|
Hello!
I can't understand why this TransparentBlt function doesn't work...
"CClientDC dc1( this );
CBitmap bmp,bmp_all;
CDC memdc2,memdc3;
bmp.CreateCompatibleBitmap( &dc1, 600,600 );
memdc2.CreateCompatibleDC( &dc1 );
memdc3.CreateCompatibleDC( &memdc2 );
memdc2.SelectObject( &bmp );
bmp_all.LoadBitmap(IDB_BITMAP_1);
memdc3.SelectObject(&bmp_all);
TransparentBlt(memdc2,0,0,97,93,memdc3,0,0,97,93, RGB( 255,255,255)); "
Help me please to correct this error.
Thanks All!
|
|
|
|
|
what happens when you try???
sergbox2 wrote:
memdc2.CreateCompatibleDC( &dc1 );
memdc3.CreateCompatibleDC( &memdc2 );
have you tried memdc3.CreateCompatibleDC( &dc1 ); ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
TransparentBlt(memdc2,0,0,97,93,memdc3,0,0,97,93, RGB( 255,255,255)) returns 0 ..
but if I change memdc2 and memdc3,
TransparentBlt(memdc3,0,0,97,93,memdc2,0,0,97,93, RGB( 255,255,255)) returns 1
|
|
|
|
|
|
TransparentBlt(memdc3,0,0,97,93,memdc2,0,0,97,93, RGB( 255,255,255)) works correct
can you give me any another way to copy memdc3 to memdc2 ( RGB(*,*,*) - transparent)????
|
|
|
|
|
Perhaps this will help?
<code>
void FooButton::TransparentBlt
(HDC hdcDest, <code>
int nXDest, <code>
int nYDest, <code>
int nWidth, <code>
int nHeight, <code>
HBITMAP hBitmap, <code>
int nXSrc, <code>
int nYSrc, <code>
COLORREF colorTransparent, <code>
HPALETTE hPal) <code>
{
CDC dc, memDC, maskDC, tempDC;
dc.Attach( hdcDest );
maskDC.CreateCompatibleDC(&dc);
CBitmap maskBitmap;
<code>
CBitmap* pOldMemBmp = NULL;
CBitmap* pOldMaskBmp = NULL;
HBITMAP hOldTempBmp = NULL;
memDC.CreateCompatibleDC (&dc);
tempDC.CreateCompatibleDC (&dc);
CBitmap bmpImage;
bmpImage.CreateCompatibleBitmap (&dc, nWidth, nHeight);
pOldMemBmp = memDC.SelectObject (&bmpImage);
<code>
if (dc.GetDeviceCaps (RASTERCAPS) & RC_PALETTE && hPal) {
::SelectPalette( dc, hPal, FALSE );
dc.RealizePalette();
::SelectPalette( memDC, hPal, FALSE );
}
hOldTempBmp = (HBITMAP) ::SelectObject (tempDC.m_hDC, hBitmap);
memDC.BitBlt (0, 0, nWidth, nHeight, &tempDC, nXSrc, nYSrc, SRCCOPY);
<code>
maskBitmap.CreateBitmap (nWidth, nHeight, 1, 1, NULL);
pOldMaskBmp = maskDC.SelectObject (&maskBitmap);
memDC.SetBkColor (colorTransparent);
<code>
maskDC.BitBlt (0, 0, nWidth, nHeight, &memDC, 0, 0, SRCCOPY);
<code>
memDC.SetBkColor (RGB (0,0,0));
memDC.SetTextColor (RGB (255,255,255));
memDC.BitBlt (0, 0, nWidth, nHeight, &maskDC, 0, 0, SRCAND);
<code>
dc.SetBkColor (RGB (255,255,255));
dc.SetTextColor (RGB (0,0,0));
dc.BitBlt (nXDest, nYDest, nWidth, nHeight, &maskDC, 0, 0, SRCAND);
<code>
dc.BitBlt (nXDest, nYDest, nWidth, nHeight, &memDC, 0, 0, SRCPAINT);
if (hOldTempBmp)
::SelectObject (tempDC.m_hDC, hOldTempBmp);
if (pOldMaskBmp)
maskDC.SelectObject (pOldMaskBmp);
if (pOldMemBmp)
memDC.SelectObject (pOldMemBmp);
dc.Detach();
} /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Very pretty!
But I do not think that is the problem.
INTP
Every thing is relative...
|
|
|
|
|