|
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...
|
|
|
|
|
It would help if you knew what you were trying to do. All we can see is you declaring some empty bitmaps and comatatible DCs. Selecting an empty bitmap into memdc2, loading a bitmap into bmp_all and selecting it into memdc3, and then doing a transparent blit to the bitmap in memdc2 (which contains an empty monochrome bitmap [black]).
INTP
Every thing is relative...
|
|
|
|
|
Yes, you are right. I want to do TransparentBlt at least to black bitmap (in memdc2), i.e. to copy picture from memdc3 to memdc2 missing white color.
|
|
|
|
|
Hi,
Is there a way in Visual Studio .NET 2003 to see the count for total line of code for a solution or a project ?
Any other way to get this data ?
Thanks,
Shay
-- modified at 15:59 Friday 7th October, 2005
|
|
|
|
|
That functionality is not built into .NET 2003. You can get add-ins and separate exe's to do that though. There are a couple of solutions on CodeProject if you search for them.
If a wizard fails to cast an enchantment correctly, is that a mis-spelling?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
found the articel, thanks !
|
|
|
|
|
Historical note. At one time some companys (or some idiot in the company) thought that the number of lines of code was related to the productivity of the people writting the code.
I some times wonder how may useless lines of code where written, just because of that idiocy.
INTP
Every thing is relative...
|
|
|
|
|
Don't worry, it's just for risk assesment calculations.
I also think it's not the quantity but quality that counts
|
|
|
|
|