|
I dunno, but maybe it would go better for you if you asked a question in your header. Most of us are also over 12, and so calling yourself h4ek4z does not help, it's bloody annoying to look at and gives an image of you as a 10 year old script kid.
Finding out what a users password is also does not sound like a sociable thing to be wanting to do.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi there...
i have been writing a simple image processing aplication under visual c++ .net, using the CImage class. but now i have to change it to be compiled under visual c++ 6 (without using gdi plus libraries...). is there any class like CImage that works under vc6?? i mean, i need a functions to open a bitmap file, to save it, to get the width, height, the pixel values, to construct one from parameters (array of pixel values, width, height, bits per pixel, just like the CImage class)...
could anyone give me a hand on that?? does it exist anything on vc6 like this??
|
|
|
|
|
Anonymous wrote:
does it exist anything on vc6 like this??
Yes, it's called GDI+. You just need an up to date SDK in order to use it. Read my GDI+ articles, they were written with VC6.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hello guys,
I created sub (child) dialogs on a parent dialog, using the class provided in this place:
http://www.codeproject.com/dialog/childdlg.asp?target=child%7Cdialog
It all works well, except I am not sure how to get all the child dialogs to interact with each other or with the parent dialog. Basically, I have a main child dialog displayed with the parent's OnInitDialog, and every button pressed on this child dialog should/will replace it with another corresponding (sub)child dialog (having being assigned them to the same GroupBox in the parent dialog). The problem is the buttons in all child dialogs do not seem to do anything, pressing them will not trigger any belonging functions at all. Only the buttons in parent dialog operate properly and can use them to switch between the child dialogs to show in the GroupBox.
Did anyone have experience with this?
Thanks alot
|
|
|
|
|
Let's say my application has a pointer to a CDialog derived class and I create some modeless dialogs.(More than one!). My question is how to destroy all of them - myPointer->DestroyWindow() - for the last created one and after that how to redirect the pointer to the rest of the dialogs in order to destroy all of them?
|
|
|
|
|
You can use DestroyWindow() to delete the underlying MFC windows handle. Obviously, if you use this on a dialog this will delete all the underlying child handles associated with that dialog box. Another method is to use PostMessage(WM_CLOSE, 0, 0), which is the method I prefer. To destroy a chain of dialog associated with each other you could try SendMessageToSiblings(WM_CLOSE). This will filter through a dialog box chain sending the message to each sibling (To be honst I've never used this method so I don't know if it will work).
If you wanted to get all object orientated about it you could look at using the composite design pattern. This design pattern is used to forming complex tree structures and works brillantly for distributing messages across its tree structure.
|
|
|
|
|
Hi,
i have created a palette using toolbar.
I'd like to know how can i make a pressed button to be displayed as pressed?
The problem is that the button is released after a mouse click.
i'd like to button to be sunken till a new button is pressed.
Thanks,
Dudi
|
|
|
|
|
OK, found it.
You need to call SetButtonStyle with TBBS_CHECKBOX | TBBS_CHECKGROUP style.
|
|
|
|
|
How to Send an event from an Automation Server to its Client?
Hello,
I wrote an Automation Server. I know how a client can get/set properties belonging to a server, but I am not sure of the right way a Server can fire events to its client.
I tried this solution: (It does actually work, but maybe this solution is "naive" and will not work in some cases)
1) The client sends (once for good), the handle of its main window (or its thread ID.
2) When the server wants to fire an event to the client, it calls either ::SendMessage or ::PostThreadMessage with an agreed message number.
Is there a better solution?
I read about IConnectionPoint. Is this relevant to my problem? Can you send me a link to an example?
Many Thanks,
Mike
|
|
|
|
|
Your solution may work, but of course "::SendMessage/::PostThreadMessage" is an ugliest soultion around (unless you don't see your server with some other client).
Adding connection point interface is straight forward: check this:
http://www.microsoft.com/msj/0598/wicked0598.aspx
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I want to change the font of a CEdit editbox. I used "void SetFont( CFont* pFont, BOOL bRedraw = TRUE )" function but it doesn't work what could be the problem. Is there other way out? Plz reply only after doing this practically.
Thanking u in anticipation.
Ravi Prabhakar
|
|
|
|
|
What you did should work.
However, it will not work if CFont * is declared in the stack. You can use a member variable instead.
Examples:
void CMyClass::IncorrectFunction()
{
CFont *font;
LOGFONT lf; // Used to create the CFont.
memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
lf.lfHeight = 20; // Request a 20-pixel-high font
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
font.CreateFontIndirect(&lf); // Create the font.
m_Sample.SetFont(&font);
}
void CMyClass::CorrectFunction()
{
// CFont *m_font; // m_font is declared as a mmber of CMyClass
LOGFONT lf; // Used to create the CFont.
memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
lf.lfHeight = 20; // Request a 20-pixel-high font
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
m_font.CreateFontIndirect(&lf); // Create the font.
m_Sample.SetFont(&m_font);
}
Hope it helps,
Mike
|
|
|
|
|
Hi, I'm trying to implement drag and drop for my application and, as a start (having done a bit of reading), have created a standard MDI ap using Developer Studio. In the view, I have (i) overridden InitInstance()and added m_OleDropTarget.Register(this); where m_OleDropTarget is a COleDropTarget object and (ii) added the function OnDragEnter() using Class Wizard. Having set a break point in OnDragEnter(), I ran the ap., opened Window Explorer, and dragged a file across my ap’s view. However, I didn’t reach the breakpoint. I have now discovered that Register() function fails on the last line shown below:-
BOOL COleDropTarget::Register(CWnd* pWnd)
{
ASSERT_VALID(this);
ASSERT(m_hWnd == NULL); // registering drop target twice?
ASSERT_VALID(pWnd);
LPUNKNOWN lpUnknown = (LPUNKNOWN)GetInterface(&IID_IUnknown);
ASSERT(lpUnknown != NULL);
// the object must be locked externally to keep LRPC connections alive
if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK)
return FALSE;
…..
…..
}
I don’t understand the comment that “the object must be locked exrernally tokeep LRPC connections alive”
And therefore what is causing the failure. Can anyone enlighten me as to what I need to do in my test ap to overcome this failure ?
Doug
|
|
|
|
|
Did you call CoInitialize[Ex]() ?
--
Talk to the hand!
|
|
|
|
|
Jörgen Sigvardsson wrote:
Did you call CoInitialize[Ex]()?
Hi Jorgen - thanks for the reply. I found my problem just after I made the posting (typical, eh !!) - I needed to select the tick boxes for OLE Automation and OLE Controls when generating the project using AppWizard - it doesn't seem to have included COInitialize() in my source files, but it's got me over the problem, until the next one pops up ...... ! Thanks again !;)
Doug
|
|
|
|
|
I finally settled on this but am still uneasy.
HINSTANCE res = ShellExecute(NULL,"Open", helpFile, "","E:\\", SW_SHOWNORMAL);
int r = (int)res;
if(r <=32)ShellExecute(NULL,"Open", helpFile, "","C:\\", SW_SHOWNORMAL);
I imagine all I need in the 5th paramtere is the drive letter where the explorer exe is stored. My assumption that its either in E or C is dangerous. How should I handle this dilemma?
Thanks,
ns
|
|
|
|
|
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = NULL;
sei.lpFile = m_strYourEXEFile;
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = NULL;
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
if (ShellExecuteEx (&sei) )
return TRUE;
else
return FALSE;
}
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I think I didnt explain right: I want the .htm file to open up in explorer. Its not an exe file.
Thanks,
ns
|
|
|
|
|
|
sorry my mistake.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Visual C++ 6.0/SP5
I have written a program that sets folders to be either "hidden" or "normal" (based on user selections). This program works just fine on Win2K and WinXP, but Win98 users aren't seeing any success at all. Here's the code I'm using:
void CMyClass::ChangeFolderAttributes(CPersonality* pItem)
{
if (g_pPersonHelper->GetChangeTrackFiles())
{
CTracksINI* pTracksINI = GetSimTrackList(SIM_NR2K3);
if (pTracksINI)
{
CString sInstalledTrackDir = "";
CString sInstalledFullPath = "";
int nInstalledCount = pTracksINI->GetCount();
for (int i = 0; i < nInstalledCount; i++)
{
sInstalledTrackDir = pTracksINI->GetTrack(i)->GetTrackDir();
sInstalledFullPath.Format("%stracks\\%s", m_sSimPath, sInstalledTrackDir);
bool bInTrackSet = g_pTrackSetHelper->GetTrackSet(pItem->GetTrackSet())->TrackIsInSet(sInstalledTrackDir);
DWORD dwDesiredAttrib = (bInTrackSet) ? FILE_ATTRIBUTE_NORMAL : FILE_ATTRIBUTE_HIDDEN;
BOOL bResult = SetFileAttributes((LPCTSTR)sInstalledFullPath, dwDesiredAttrib);
}
}
else
{
}
}
else
{
}
}
I've scoured the MSDN stuff, google the API calls, and checked a number of programming bulletin boards, but there is no mention of an incompatibility.
The one thing I did notice is that when I manually select a folder and set it to hidden (using Windows Explorer) Win2k asks is I also want to hide all of the sub-items. I don't have a Win9x box, so I can't see if Win9x does the same thing, but I don't remember that happening.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Two things I'd change.
1. The line that builds the full path:
sInstalledFullPath.Format("%stracks\\%s", m_sSimPath, sInstalledTrackDir); is assuming backslashes in certain places. Is that always right? I'd use the shlwapi functions instead (like PathAppend() ) to build the name.
2. You're calling SetFileAttributes() without getting the existing attributes first. This results in you unsetting the FILE_ATTRIBUTE_DIRECTORY attribute, which might be what's causing the error. You should always get the current attrs and modify them. I'd do:
DWORD dwAttrs = GetFileAttributes ( sInstalledFullPath );
DWORD dwDesiredAttrib = bInTrackSet ? FILE_ATTRIBUTE_NORMAL : FILE_ATTRIBUTE_HIDDEN;
if ( INVALID_FILE_ATTRIBUTES == dwAttrs )
else
{
dwAttrs &= ~(FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_HIDDEN);
dwAttrs |= dwDesiredAttrib;
BOOL bResult = SetFileAttributes ( sInstalledFullPath, dwAttrs );
}
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
If my rhyme was a drug, I'd sell it by the gram.
|
|
|
|
|
How Creating Login with Password included by Dot?
I need to connected also thru Telnet/FTP but to access to a Tandem machine (or whatever server types)from these must be(for example:"User=yulisa,password=yls.11").
-Also,How to facilitate Fstream(input.dat -->output.dat),which
at the middle after recieve from input.dat, I must absorb each/all field's value to Edit Boxes navigated by Next-Previous Icon,or by DBGrid provided by MFC,then all those records can be Restored to Database,ex:SQL Server for next purposes manipulation???(maybe Database as the Output File)
....I Need the Right Ansewr Soon, Thanks a Lot Before....
|
|
|
|
|
How Creating Login with Password included by Dot?
|
|
|
|
|
Hi all ,
does any body knows any thing about programming USB Port or IEEE 1394 (Firewire)
Mhmoud Rawas
------------
Software Eng.
|
|
|
|