|
Try this,
http://tinyurl.com/3gn88
|
|
|
|
|
that's GDI+ doc... it shows how to load an Icon or an image from a file.
I would like to load a bitmap from a resource (already bind with the program).
|
|
|
|
|
Hi!
I have a DLL with a JPEG ressource and the main App,
that shows this.
here ist the Code from the DLL:
BYTE* GetLogo(int &nSize) {
DWORD dw;
HRSRC hRes = FindResource(theApp.m_hInstance,_T("IDR_LOGO"),_T("Images"));
dw = GetLastError();
HGLOBAL hg=LoadResource(theApp.m_hInstance,hRes);
LPVOID lpRes=LockResource(hg);
nSize = SizeofResource(theApp.m_hInstance,hRes);
dw = GetLastError();
return (BYTE*)lpRes;
}
and here ist the code from the APP:
void CWBLogoWnd::SetImage(BYTE*pBuffer, int nSize) {
IStream *pStream;
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, nSize);
if (hGlobal)
{
void* pData = GlobalLock(hGlobal);
if (pData)
memcpy(pData, pBuffer, nSize);
GlobalUnlock(hGlobal);
CreateStreamOnHGlobal(hGlobal, TRUE, &pStream);
}
#ifdef _DEBUG
#undef new
m_pImage = new Image(pStream,true);
#define new DEBUG_NEW
#else
m_pImage = new Image(pStream,true);
#endif
}
|
|
|
|
|
ok it works
Thanks a lot!
|
|
|
|
|
I have .NET installed on my pc. Unfortunately its not on a single dvd but on 7 cds. So having been through this process several times before , this time is there an easy way to copy a .NET installation onto another machine so I can avoid the 7 cd scenario.
Basically apart from dragging the relevant folders overs is there anything else. I would copy over the reg keys as well. ANy hidden traps. Anyone actually done this? Is it possible to create a dvd on the .NET install from a vanilla install of the 7 cds. Sort of like windows slipstreaming service peaks. Sorry to be a little off topic. At least I mentioned .NET!
Thanks,
|
|
|
|
|
anonymous wrote:
At least I mentioned
you are waaaaaaaaaaaaaaaaaay of topic , not just the forum but also what you are trying to do,
One cannot copy the folder from one pc to another and you have .net installed.
Sure there is a way if you can mirror the hardrive, but then not sure that will work too.
plus you will lose all data in the destination hardrive.
Simple solution, install the .net in the new pc using the 7 cds.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
surely someone has done this. I cant be the first one to try. It worked under dos.
ANyway surely its just the registry that might make it hard. Maaaybe .NET puts stuff in other places. Do you know how painfull it is to install the .NET with 7 cds. Talk about wasting an afternoon.
|
|
|
|
|
Anonymous wrote:
It worked under dos
are we talking about dos or windows? both are different os and works different too.
Anonymous wrote:
surely someone has done this
note sure.
Anonymous wrote:
ANyway surely its just the registry that might make it hard. Maaaybe .NET puts stuff in other places
it puts hundreds of registry entries.
Anonymous wrote:
Do you know how painfull it is to install the .NET with 7 cds. Talk about wasting an afternoon
with your method of copying will take humm may be all week. be smart put the CD1 inside the tray and click on setup.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
well the visual studio .NET folder is 1.64 GB and the one on c:\ drive is 7.95 MB.
( I have a installation not in the default place)
Creating a dvd 80% full takes about 30 mins so I dont think the above copy will take too long.
mmm regedit has an export branch option. That export/import shouldn't take long.
THe question was not about whether its hard but if its possible? If someone has done it.
Thanks for your suggestion though its just that I have installed .NET with 7 cds too many times
|
|
|
|
|
Anonymous wrote:
Do you know how painfull it is to install the .NET with 7 cds
Do you know how painful it is to use .NET if it is not installed correctly?
With all the time you are wasting trying to figure out a different way to install, you may as well have been installing.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
>Do you know how painful it is to use .NET if it is not installed correctly?
yes
>With all the time you are wasting trying to figure out a different way to install, you >may as well have been installing.
True,
but the saving is the next time I have to do it, Or for the other people that don't want to use 7 cd's. Thats why we spend a lot of time getting an adt correct so that we can package it into a dll and be done with it.
I already have .NET on my main machine is not like its mission critcal to get it done.
Thats why I can afford to think about an easier way to apply the update.
I might try it and get back to you.
|
|
|
|
|
Can I keep a DDB for painting? DDB is comfortable for a special DC,
I wonder if I can keep a DDB and use it to paint to a DC repeatedly.
eg.
class CMyButton : CWnd
{
public:
CBitmap m_bmBtn;
}
CMyButton::OnCreate()
{
....
m_bmBtn.CreateComfortableDC(pDC);
...
// Draw to m_bmBtn , can i keep it and use it in OnPaint?
}
CMyButton::OnPaint(CDC* pDC)
{
CDC memDC;
......
CBitmap* pOld = memDC.selectobject(&m_bmBtn);
pDC->BitBlt(0, 0, nWidth, nHeight, &memDC, 0, 0, SRCCOPY);
.......
);
}
|
|
|
|
|
Maybe the question is what are differences between RAS (remote access service) and Internet dialup connection on WIndows platform?
DJ
|
|
|
|
|
I have a application which has form view.when i click a button on the form i need to load a dialog at a specific location on the form.How can i do it....?
|
|
|
|
|
swarnamanoo wrote:
need to load a dialog at a specific location on the form.
I don't understand your question. Do you want a modal dialog to be displayed in response to the button click, or do you want a set of controls to appear on the form view when the user clicks the button?
If it's the former, write a handler for the button and display your dialog by calling its DoModal() method. If it's the latter, create a modeless dialog (whose parent is the formview) and show it in response to the button click.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi Ravi,
You are absolutely right!
I want to implement the latter part.I have some controls in a dialog and those need to be displayed on the form.As iam new to programming i could not understand where to set the Parent for the dialog.I've used Setparent() function, but its not working.
Thank You for ur suggestion.
|
|
|
|
|
The modeless dialog's parent gets set on creation. Declare an instance of the modeless dialog as a member of your formview. Then, in response to the button click, do this:
VERIFY (m_dlgModeless.Create (IDD_MODELESS, this));
m_dlgModeless.MoveWindow (...);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Create a place holder using a staticrect on the form where you want the dialog box to appear.
Remove the titlebar of the dialog box.
when you click on the button, create the dialogbox as modeless and using the rectangle area of the static rect move the dialogbox into that area using MoveWindow
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hi,
I want to make simple program to get printerstatus from assembly language.
From New project, i choose win32 console application - empty application.
But, when i put this code to empty source file (.cpp)
void main()
{
unsigned char iRetVal = 0;
__asm
{
mov ah, 02h
mov dx, 0 /* 0 is number for LPT1: */
int 17h
mov iRetVal, ah
}
if (iRetVal == 0x90)
cout<<"success"<
|
|
|
|
|
what Os are you using?
NT, 200, xp will not allow you to access the hardware directly.
tcss
|
|
|
|
|
You must be run only on Win95/98
for WinNt/2x/Xp/03 you must know kernal programming for accessing the ports and other stuff..
regards
Balkrihna Talele
|
|
|
|
|
I can't remember where offhand, but there are some libraries around that let you access the printer port undert NT/2000/XP.
Elaine
The tigress is here
|
|
|
|
|
Others have already explained why the HAL is blocking access to the printer port. I would like to point out that you can keep your program from outright crashing by using a try/catch block. Something like:
void main( void )
{
unsigned char iRetVal = 0;
try
{
__asm
{
mov ah, 02h
mov dx, 0
int 17h
mov iRetVal, ah
}
if (iRetVal == 0x90)
printf("success\n");
else
printf("failed\n");
}
catch(...)
{
printf("exception\n");
}
} This doesn't help with the port access, but does give you control over the previously unhandled exception.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi All,
Thank You.
Because I use win2000 it doesn't work and when I try in win98, it works fine.
I think this topic can be close now.
|
|
|
|
|
Hi,
I am using VC+ 7.0, how can i add an image in dialogbox(MFC Dialog based appln) which will appear in starting of the application as background for that window. How can we add controls on that window.
Thank you........
|
|
|
|