|
Hi All,
I want to create an imagelist from the files selected by the user. How can I do that? Is any sample code available?
With regards
A.Santosh
|
|
|
|
|
Hi there
I have a problem Maybe anyone is able to help me to solve this problem Here we go....
There is a window with a frequently changing background . Now i want to add a child window to this window. I also want that the child is "transparent". This isnt a great problem! Using GetDC, CreateCompatibleDC and BitBlt ... manually it works! But ... when the image of the parent window changes ... how can the "child" window notified so the WM_PAINT handler is fired??
Any ideas?
Thanks for reading
|
|
|
|
|
Hi,
WM_PAINT is called over 4 reasons:
1) application starts
2) application is being minimized
3) application is being maximized
4) a control is hiding an other control (moving over it)
if you want to "fire" WM_PAINT you can call either Invalidate or Redraw.......
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
an other approach :
in the dialog resources, check the 'clip children' and 'clip siblings' check boxes.....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I missed to mention that the other window which the child should be added is another application. I dont have control over it
I dont want to subclass the parent window because if my application crashes the other application must be restarted
|
|
|
|
|
I have a freeware program that was writtn in C++ MFC that I would like to study it's structure. Unfortunatly, I don't have access to the source code for debugging. Is there a way to get the source code from the bin disassembly?
|
|
|
|
|
|
Hi,
I'm writing a program that incorporates a Rich Edit control text editor containing consisting of an arbitrary number of "documents". On the left of the screen is a tree view, and on the right of the screen is a rich edit control for text editing. The user uses the tree view to create new "documents". By clicking on a tree view item, the document that that represents should appear in the rich text control on the right. All of this has to be saved to a single file (possibly using structs), and exported to an RTF. Saving to RTF is sorted (thanks to help from users here), but my problem is this:
How can I save an entire "document" to a string? I have tried saving to a char*, but I haven't got it working.
Note that I am using _no_ MFC, and I am not a very experienced programmer - I am still on a steep learning curve, so please forgive any idiocy in my code.
This is what I tried:
<br />
char* szTextTest;<br />
long nTest;<br />
<br />
static DWORD CALLBACK <br />
MyStreamInStringCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)<br />
{<br />
memcpy(pbBuff,szTextTest,nTest);<br />
<br />
*pcb = cb;<br />
<br />
return 0;<br />
}<br />
<br />
void LoadRTFFromString(HWND hWnd, int nIDDlgItem)<br />
{<br />
EDITSTREAM es;<br />
<br />
es.pfnCallback = MyStreamInStringCallback; <br />
<br />
SendDlgItemMessage(hWnd,nIDDlgItem,EM_STREAMIN,SF_RTF,(LPARAM)&es);<br />
}<br />
<br />
<br />
static DWORD CALLBACK <br />
MyStreamOutStringCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)<br />
{<br />
nTest = cb;<br />
szTextTest = new char[cb];<br />
memcpy(szTextTest,pbBuff,cb);<br />
<br />
*pcb = cb;<br />
<br />
return 0;<br />
}<br />
<br />
void SaveRTFToString(HWND hWnd, int nIDDlgItem)<br />
{<br />
EDITSTREAM es;<br />
<br />
es.pfnCallback = MyStreamOutStringCallback; <br />
<br />
SendDlgItemMessage(hWnd,nIDDlgItem,EM_STREAMOUT,SF_RTF,(LPARAM)&es);<br />
}<br />
Even if I could get the above working, would I be able to save the character pointer, szTextText, to file using WriteFile() and have it save all the text it has been allocated? I have only ever saved structures containing chars that aren't pointers to file so far...
If I can copy the whole of a formatted RTF file to a string, this is what I am thinking of doing to save the structure:
For each folder, copy text into the string such as "{{folder:name_of_folder;}}" or some such, and then add to the end of that the rich text that is associated with that folder. When reloading from file, I just need to search the string for occurrences such as "{{folder::...}}" etc in order to rebuild my treeview and associate text appropriately.
Thus the string created to hold the rich text needs to be infinitely long - or rather, it needs to be capable of holding formatted text that could run into the 100,000s of *words*.
To clarify, in case that was a bit long winded: I need to find a non-MFC way of saving and loading all of the text from a rich edit box into a string. And I need to be able to append to that string the text from _other_ rich edit boxes.
If anybody could give me any hints on how I could go about this, I'd be really grateful, as always.
Many thanks,
KB
|
|
|
|
|
|
I've been downloading some projects from the site, the latest one being the grid control, and keep getting this error during linking of the project (in vc 6.0):
Linking...
LINK : fatal error LNK1104: cannot open file "mfc42u.lib"
Error executing link.exe.
I only have mfc42.lib. What do I have to do to fix this?
Ed
|
|
|
|
|
The u stands for unicode.
You have to change the configuration of your project to win32release or win32debug.
Another way to fix this will be installing the unicode versions of mfc.
Hope this helps
sledge
|
|
|
|
|
'Sledge' is correct, you can change the project settings to not use Unicode builds ... but if you HAVE to use Unicode, and have the Visual Studio Install/MSVC 6 install CDROM, run setup, select Customised install, you should then be able to select Unicode components
(been a while since I had to do it, so those instructions are a bit rusty, but that's the general technique)
'G'
|
|
|
|
|
Hi..I am also new in vc++, I faced this problem and I solve it...
Follow the step:
1:Search(find) MFC42U.LIB file from the Installation CD
2:Copy the file
3:Paste into the VC\Lib files
no issue..at all...
|
|
|
|
|
I'm trying to convert a C program into a VC++ program and have everything compiling but I get a ton of Link errors.
The error I get is:
error LNK2005: ... already defined in ...
I'm getting 230+ of these error and don't really know why. I've used #pragam once in all the headers, but still get this error.
Any help on this error or converting C to C++?
Thanks,
Jim
|
|
|
|
|
Does the symbol correspond to a global variable? Something like this?
int global; If so, try writing this in the .h file:
extern int global; and then this in just one .cpp :
int global=0; If this works and you're curious, I can try to explain the reason of your problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It's defined in a header with the extern key word.
|
|
|
|
|
Here is what is defined in the header file:
#ifdef ELABORATE_ALL_VARIABLES
D2N_GLBL_STRUCT *D2N_GLBL;
void D2N_GLBL_Elab( void );
void D2N_GLBL_Elab( void )
{
D2N_GLBL = (D2N_GLBL_STRUCT *) calloc( sizeof(D2N_GLBL_STRUCT), 1);
}
#else
extern D2N_GLBL_STRUCT *D2N_GLBL;
#endif
|
|
|
|
|
remove extern D2N_GLBL_STRUCT *D2N_GLBL; ??????? What is that remove thing? Could you explain what this file (is it a header?) is supposed to do, and what role does the macro ELABORATE_ALL_VARIABLES play?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I wish I knew, but I've never seen the program run before! I'm just having to port it to C++.
The remove was something I forgot to remove when debugging.
I think that this Macro does two different things based on what function is using it.
|
|
|
|
|
Ok. We can try to make an educated guess
My opinion is that the header is used both for declaring things and for defining them. The second use is activated by ELABORATE_ALL_VARIABLES . Let's say the header is called a.h : then I guess you have to #include it like always everywhere except in the one file a.cpp , where you should have to write:
#define ELABORATE_ALL_VARIABLES
#include "a.h"
... or, alternatively, define this macro for a.cpp in the properties section of the file (Fileview pane->right click on a.cpp ->Settings->Preprocessor definitions).
Good luck. Let me know if I can give you more assistance.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I was wondering if it was at all possible, when 'maximizing' a dialog box, to make it so that it doesn't cover up the main menubar? When my dialog box maximizes itself, I want it to maximize to the size of the parent frame (if that's what the part below the menubar is called). Is this possible, if so, how?
|
|
|
|
|
You can resize your dialog to its parent's client area, which you can get by calling GetClientRect() . You'll probably need to convert the rect to screen coordinates before resizing your dialog. Something like this (untested!):
CMyDialog::doMaximize()
{
CRect rect;
GetParent()->GetClientRect (&rect);
ClientToScreen (&rect);
MoveWindow (&rect);
}
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
How to change language using VC++: for example, my windows XP is french and to read and use programs oriented for another language I have to perform a long operation of changing default language on my system. Where can I find information about this?
|
|
|
|
|
User LoadKeyBoardLayout API
By Setting the appropriate langauge Id to this APi One can switch between different langauge
Atif
|
|
|
|