|
Rage wrote:
Christian Graus wrote:
My suggestion in that case would be that there's not much you can do if you're right and Windows CE does not support all of C++. You'd have to delete and recreate the array
OK, that´s what i do.
As do I but the replies I get are somewhat newbieish.
Rage wrote:
For sure ... but there is surely a Delphi command to do that, so that is why he asked
Not that I know of... I quit using Delphi 5 years ago. Just recently I decided to pick up on some windows REAL programming.
Cheers,
/T
|
|
|
|
|
Christian Graus wrote:
However, he did not say he cannot use STL, he obviously does not know it exists.
I know it exists... and WTL and COM, COM+, DCOM, etc, bla, bla, bla... This is what somewhat disturbs me. There's always more than one solution to the problem. That's great you might say, well, maybe, if you're willing to spend most of the time consulting msdn and other not-up-to-date docs.
I'm coming straight out of the Unix world so please bear with me... There's obviously a reason for not teaching windows programming at college level.
But I'm not gonna fold! I've dug through a great portion of COM so STL is the next step, but much of the good'ole unix pure ansi c++ is still in my back bone so it'll take some time.
Cheers,
/Tommy
|
|
|
|
|
Tommy Svensson wrote:
But I'm not gonna fold! I've dug through a great portion of COM so STL is the next step, but much of the good'ole unix pure ansi c++ is still in my back bone so it'll take some time.
I'm sorry if my comment seemed to be putting you down - that is not what I meant. You asked how to do a resizeable array, the answer is vector ( BTW I quoted the abover because the STL *is* pure ANSI C++ ). Then someone else jumped in and said what about CE, which is not what you asked, and I pointed that out. WinCE may well be garbage, but you did not indicate that you knew vector solves your problem, and so I informed you that it does. There is ALWAYS more to learn, that is the fun part of doing this stuff !!!
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Now me also face the same problem..iwant the extra memory allocation in run time..it is urgent...if u can suggest any methos do it ...please stop the unworthy comemnts posting..so please save the codeproject...
if there is nothingto do..keep Mum...
Renjith-The CPian.
|
|
|
|
|
What is unworthy ? I TOLD him how to do it. I clarified my point.
Renjith - The CP ian wrote:
if there is nothingto do..keep Mum...
So if it can't be done I should not say so ?
You need vector. End of story. Without a class like vector to do it, you simply cannot resize an array. Even vector, if you did not reserve the space, may well resize the array as a new one internally - that's obvious. An array is a lump of continuous memory. Reserve it first, or you will probably find the space is not there.
I wonder if I should stop trying to help people, if my comments are 'unworthy' because they are not what you want to hear.....
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I'm trying to copy a bitmap to clipboard using GDI+ here the code:
AfxGetApp()->m_pMainWnd->OpenClipboard();
EmptyClipboard();
Bitmap bitmap(pView->GetWidth(), pView->GetHeight());
HBITMAP hBitmap;
Color background(255,255,255);
bitmap.GetHBITMAP( background, &hBitmap);
SetClipboardData(CF_BITMAP,hBitmap);
Jonathan de Halleux, Belgium.
Jonathan de Halleux, Belgium.
|
|
|
|
|
I presume it's not working ?
At first glance, I don't see you giving up ownership of the bitmap, which now belongs to the clipboard.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
In GDI you had Detach function inheretid from CGdiObject, but in Bitmap, I don't see any similar function ???
How do you detach the HBITMAP from Bitmap object ?
Jonathan de Halleux, Belgium.
|
|
|
|
|
I have no idea, sorry. Perhaps you need to create a HBITMAP, a HDC, and then copy the Bitmap into it by attaching the HDC to a Graphics object after putting the HBITMAP into it.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Yes, that's what I though. So in fact, you must use good old GDI to pass stuff to the clipboard
HBITMAP hBitmap;
Color background(255,255,255);
bitmap.GetHBITMAP( background, &hBitmap);
HDC hBitmapDC = ::CreateCompatibleDC(hDC);
HBITMAP hBitmapDetach = ::CreateCompatibleBitmap(hDC, pView->GetWidth(), pView->GetHeight());
HANDLE oldBitmapHandle=::SelectObject(hBitmapDC, hBitmapDetach);
HANDLE oldHandle = ::SelectObject( hDC, hBitmap);
::BitBlt(hBitmapDC, 0, 0, pView->GetWidth(), pView->GetHeight(), hDC, 0,0, SRCCOPY);
::SelectObject(hBitmapDC, oldBitmapHandle);
::SelectObject(hDC, oldHandle);
::DeleteDC(hBitmapDC);
hResult = ::SetClipboardData(CF_BITMAP,hBitmapDetach);
That's it.
Jonathan de Halleux, Belgium.
|
|
|
|
|
Maybe this is a stupid question:
what's the meaning of this line:
using namespace std;
Thanks
|
|
|
|
|
ex:
namespace mynamespace
{
void DoThis(void* p)
{ ...}
}
namespace mynamespace2
{
void DoThis(void* p)
{ ...}
}
//you can use it like this
mynamespace::DoThis(myPointer);
mynamespace2::DoThis(myPointer);
//or
using namespace mynamespace;
DoThis(myPointer); //using namespace mynamespaces
Does this make sense?
Recommend you check up on namespaces.
|
|
|
|
|
In the example above he defined some stuff as being within a namespace. The C++ standard library with classes such as vector and string live inside the std namespace. Thus, "using namespace std" avoids having to qualify everything we use from the standard library with std::, eg std::vector.
Ben
|
|
|
|
|
Generally using namespace std; is shorthand for 'I don't know how to program C++'. Let me explain
A namespace is a way of avoiding name clashes.
namespace a
{
int i;
}
namespace b
{
int i;
}
Now I have two i's, I can access them like this:
a::i = 2;
b::i = 4;
I could also do this:
using namespace a;
i = 2; // = a::i
b::i = 4;
BUT what if I had a third, global i ? Then this would not work. And that illustrates the problem with 'using namespace std'. std contains a TON of stuff, and it MAY contain more in the future than it does now, or different implimentation details under different implimentations of C++. So this means you have no idea what you are including, or if it will break the code sometime in the future, if it does not now. Instead you should do this:
namespace a
{
int i;
int c;
}
namespace b
{
int b;
int d;
}
int i;
using a::c;
using b: ;
a::i = 2;
c = 7;
d = 5;
Seperate using statements for those parts of std you want to use are the way to go. For more 'real' examples of this, check out the use of 'using' in all my STL articles on CP.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
gentlemen:
I made an ATL project by following an example in a book named ATL Developer's Guide. This project needs a Proxy/Stub DLL, and the book tell me this: by using following debug command I can get this Proxy/Stub DLL
------------------------------------------------------------------------------
nmake -f serverps.mk
-----------------------------------------------------------------------------
My question is, how to run this command, and get the Proxy/Stub DLL as a result.
More information:
OS: Wnd2k
IDE: VC++6.0
Example source: 4.13.8 step 8 debug and register Proxy/Stub DLL
author: Tom Armstrong, Ron Patton etc.
Book name: ATL Developer's Guide, 2nd Edition
Best regard.
One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
hi all,
what is the way to get Remote system Information(I need the following Information for a Remote system with in the LAN)
1.Processor Speed
2.Mian Memory
3.Free Memory(physical and Paged)
4.Processes
5.Video Memory
6.Norton Anti virus update details
if any source availabel to this i am very happy.
thanks in advance
|
|
|
|
|
Use WMI. It has a steep learning curve (at least for me), but gives you access to anything in the windows world.
Key words to search on: WMI WBEM WIN32_Processor
|
|
|
|
|
I am writing 2 activex controls. I wanted to pass a function pointer between them. Is this possible? Any clues how??
|
|
|
|
|
It's not possible.
You could aggregate the function in some interface and then pass the interface pointer between the controls.
rechi
|
|
|
|
|
I have an 8bit DIB as a bitmap resource.
The problem is that I can't paint the bitmap properly in 256 color mode. When the bitmap is displayed its colors look strange.
I use LoadBitmap to get the handle to the bitmap and then I blit it to the screen from memory context.
Is there any quick way to solve this problem ? How do I get the palette from the bitmap resource ?
|
|
|
|
|
Use LoadImage with LR_CREATEDIBSECTION so that your bitmap
is loaded as a DIB.
Then use GetDIBColorTable to get the bitmap's colors and
CreatePalette to make a palette from them.
Use SelectPalette to select your palette into the DC, and
then RealizePalette to get your colors into the system
palette.
Your bitmap should then look ok.
|
|
|
|
|
Can anybody reccomend a good map control to use ?
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
More about me
|
|
|
|
|
Hello
Im coding a SNMP agent, and I want to implement all the standard MIB's. But I havent found any specifications of standard MIB's
Anyone that got info about standard MIB's for SNMPv1, v2, v3?
thanks,
Verifier
|
|
|
|
|
Hello.
For a c++ Prog. i get CTime-Object from a access-DB.
Converting into a Time-String for a Edit-Field is not
a Problem. But:
I have for Input three Date-Time-Picker, one for the day,
the month, and the year.
I've a great Problem to show the corrct dates in the
Date-Time-Picker.
First i'have tryed with a member on the dtp to convert
the format member.setformat("dd"). This was ok. The
DTP caught the systemtime korrekt in the form.
But now I want to initialisize these tree DTP's with
the Access CTime-Object. I'have tryed to split the
CTime-Object with Format %d,%m,%Y)an then with setwindow
text as Cstring. day and month was ok, but not the year
(1970, instead of 1980), by the same method.
Otherwise by storing i must store these three objects
(day,mon, year) into a CTime-Object.
Has someone a good idea for handling this?????????
Thanks....
|
|
|
|
|
Here is my problem
I want to check a specific folder in FTP for the checking of arrival of new file in a specific interval of time..i think i can do that by comparing the latest date/time of the file..how can i get the date/time of the file(or such file related info other than filename) created in a FTPfolder,i think there is no such member functions for CFTPConnection or CFTPFileFind..
help wanted..!!!
|
|
|
|
|