|
|
You could write an event handler for the WM_KEYDOWN event, and if the key pressed was event then call the default event handler after changing the key pressed to Tab.
Does that make sense?
Pete
|
|
|
|
|
Hi all
I have C++ application that I want people to demo via a webpage.
Is it posible to Write a Java Applet to interface my application?
I would of course have to serve the application off of my web server.
Is this possible??
any help appreciated.
IGeorgeI
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
|
if u mean a java runs ur c++ exe, it is very easy, use java code:
Runtime.exec
that is all.
includeh10
|
|
|
|
|
Hi all,
I need to set quota limit for users on a shared folder on a file server.
How to implemented it in VC++? Is there a API function?
Thanks
|
|
|
|
|
Check these COM interfaces:
IDiskQuotaControl
IDiskQuotaEvents
IDiskQuotaUser
IDiskQuotaUserBatch
IEnumDiskQuotaUsers
AFAIK, there's no non-COM API with HQUOTAs and such.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Dear all,
This problem of mine has been bugging me crazy.
I have to load a 24bit .bmp file and convert it to a 32 bit bmp file.
I've manage to load the bitmap file, display it on the screen and even made the code to make it a 32bit bitmap.
The problem is to attach the modified bits to the m_bmpBitmap CBitmap object. Then I get the info of the m_bmpBitmap with the BITMAP structure.
BITMAP bm;
m_bmpBitmap.GetBitmap(&bm);
The bm.bmBits is 0x0 which it shouldn't be.
All the CreateBitmap() and GetBitmap() funtions return successful but I can't even display the image to screen and I feel it is due to bm.bmBits = 0x0.
I've even tried to create a 24 bit bitmap with the same method below and it didn't work too.
I would like to be able to view the image that I created and as well as to be able to save it. I welcome any new ideas on how to approach this matter.
Many many thanks.
Chun Te, Ewe
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
CBitmap m_bmpBitmapOri;
CBitmap m_bmpBitmap;
BYTE *m_pOriSrc, *m_pSrc;
HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), "h:\\logo.bmp"
,IMAGE_BITMAP, 0, 0, R_LOADFROMFILE | LR_CREATEDIBSECTION);
m_bmpBitmapOri.Attach(hBitmap);
BITMAP bmOri;
m_bmpBitmapOri.GetBitmap(&bmOri); // Get the loaded bitmap
m_pOriSrc = (BYTE*)bmOri.bmBits; // Pointer to the original bitmap bits
// Prepare a new location
if(m_pSrc!=NULL) delete [] m_pSrc;
m_pSrc = new BYTE[(bmOri.bmHeight+1)*bmOri.bmWidth*4];
...
some code to change from 24bpps to 32 bpps (if needed I can provide)
...
if (m_bImageValid) m_bmpBitmap.DeleteObject();
// Creating the image
m_bmpBitmap.CreateBitmap( bmOri.bmWidth, bmOri.bmHeight, 1, 32, m_pSrc );
BITMAP bm; // Obtain info regarding bitmap
m_bmpBitmap.GetBitmap(&bm); //
// Create a device contect to load the bitmap into
CDC dcMem;
CClientDC pDC(this);
dcMem.CreateCompatibleDC(&pDC);
dcMem.SelectObject(m_bmpBitmap);
pDC.BitBlt(250, 7, bm.bmWidth, bm.bmHeight, &dcMem, 0, 0, SRCCOPY);
// Won't display image
|
|
|
|
|
I want to scroll to the last line of my edit box. Is there a simple way to do this? Thanks
-Ken Mazaika
|
|
|
|
|
I tried this...is there a reason it didn't work?
class CMsgBox : public CEdit<br />
{<br />
protected:<br />
LESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);<br />
};<br />
<br />
<br />
and in the module:
#include "headerFile.h"<br />
<br />
LRESULT CMsgBox::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
LRESULT result = CEdit::DefWindowProc(message, wParam, lParam);<br />
if (message == WM_SETTEXT)<br />
SendMessage(EM_SCROLL, SB_BOTTOM, 0);<br />
return result;<br />
}<br />
Is there something I'm going wrong? Thanks.
-Ken Mazaika
|
|
|
|
|
My release build works but the debug build crashes at at the delete. It says its a memory check error. The release version sails on through. Actually the debug version will keep going after the crash(retry) then crash again, and retry restores it. So the logic is working but I'm doing something really wrong.
memory check error at 0x002F59AA = 0x00, should be 0xFD.
Any ideas?
Thanks,
ns
char* photo1;
photo1 = new char [strlen(pDoc->m_db.m_photoInfo)];
strcpy(photo1,pDoc->m_db.m_photoInfo);
char* pDelimiter = strstr (photo1, ",");
ASSERT (pDelimiter != NULL);
*pDelimiter = '\0';
char* dbname = photo1;
m_PhotoDBName = dbname;
pDelimiter++;
CString mineName = pDelimiter;
<code> delete[] photo1</code>;
When I hit debug, it gave the error (user breakpoint called from code at (some address).
It went into dbgheap.c. Does this help in diagnosing the problem?
|
|
|
|
|
You need to allocate room for the terminating NULL
photo1 = new char [strlen(pDoc->m_db.m_photoInfo) + 1];
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Well, that took care of one of them! The next crash is again at a delete[] (I just started using delete!) It turns out to be a variable I dont need, but still want to know whats wrong:
m_pCommandPhoto->ActiveConnection = m_pConn1;
CString partQuery = "'"+MineName+"'";
char* partQuery0 = new char(partQuery.GetLength()+1);
strcpy(partQuery0,partQuery);
CString SQLQ = "SELECT * FROM tblMine WHERE (DefID = "+partQuery+")";
char* SQLQuery = new char [SQLQ.GetLength()+1];
strcpy(SQLQuery, SQLQ);
AfxMessageBox(SQLQuery);
<code>delete[] partQuery0;</</code>pre>
Thanks,
ns
|
|
|
|
|
You've used () in the new statement, which makes the length a parameter that is passed to the char constructor. This means that your newing with the non-[] form so delete [] fails
change it to
char* partQuery0 = new char[partQuery.GetLength()+1];
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Thanks so much. So a new done my other way with () is legal? I didnt think we could do that. I appreciate your help,
Thanks,
ns
Incidentally the release version was perfectly happy with it!!! Would this have shown up later as a problem in the release?
|
|
|
|
|
ns wrote:
So a new done my other way with () is legal?
Yes, although it means an entirely different thing. This allocates one char and initializes it:
char* pch = new char ('a'); Since chars and ints are interchangeable to a degree, you can stick a number less than 255 in place of 'a' above.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Great! Thanks for the explanation. Appreciate it!
ns.
Wonder why the release exe didnt crash.
|
|
|
|
|
One bit of advice: why on Earth are you bugging yourself with new/delete when you're already using CString? Instead of new/strcpy just declare a CString and assign your text.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Hi!
I have a dialog based app. I have a bunch of child dialog in my main dialog which I keep showing and hiding based on a few user actions. I need to know when these child dialogs loose focus. I tried WM_KILLFOCUS, WM_ACTIVEATE, but for some reason neither of these messages get sent to my child dialog or even my main dialog for that matter. Does anybody have any suggestions on how I could fix this or maybe get around it?
Thanks,
NC
|
|
|
|
|
How are you showing your child dialogs? Are you using DoModal() (modal dialogs) or Create() with ShowWindow() (modeless dialogs)?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi!
I am doing a create() and ShowWindow(). They are modeless dialogs.
Thanks
NC
|
|
|
|
|
WM_ACTIVATE is the message you want to handle. It is sent to the window being activated, then to the window being deactivated.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi!
I tried WM_ACTIVATE too. But for some reason, that doesn't get sent when activating the dialog or even when deactivating the dialog.
One more quick question regarding this - if the focus is on one of the controls on the dialog and if the focus is moved to another dialog altogether, will the original dialog which looses the focus still get the WM_ACTIVATE msg even though the focus was on one of the controls and not really on dialg. I am thinking that this is what is happening in my case since I am not getting the msg.
Thanks,
NC
|
|
|
|
|
I mean, an easy way, like:
<br />
bool isConnected = IsConnected(mySocket);<br />
Or maybe with the select() function?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hello, the codegurus around the world.;)
At CAsynSocket, OnConnect member function will return the error code
called "WSAEISCONN The socket is already connected".
So, you can call Connection function by some interval time, and
check if OnConnect will return this error code.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|