|
|
Could you also, please please please, tell me if it has this CArray? Before I download and install it... Thanks
|
|
|
|
|
|
I know I'm being annoying, but does it have the same interface as teh MFC's CArray. Can I use it as a drop-in replacement (after a typedef of course)
PS: I'm really sorry to be such a pain, but I really don't do MFC/ATL/WTL stuff at all (yes, I've looked up MSDN... lists less member functions that CArray, but it's only the ATL CSimpleArray - just really not sure about it all)
thanks
|
|
|
|
|
|
a) VC7 : makes the CStringT template available for both ATL and MFC projects
b) WTL (clickety[^]) : provides a 1:1 CString clone for ATL/WTL projects under VC6. The ATL/WTL framework emphasizes "link on demand", so you could basically create a raw Win32 application/library with CString
c) On Codeguru you'll find a macro that extracts the CString sources from your MFC library, so oyu can add them to any other project
d) there are some CString clones[^]. However, with the availability of WTL, there's rarely a need, unless you need to be portable
e) finally, you can "rip out" the WTL CString class. All that CString needs from the framework is the Ressource HINSTANCE for implementing LoadString and similar functions. (IIRC there are some more system-dependent elements, which can be easily replaced)
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
ofcourse it is possible. to the best of my knowledge everything is possible.
click the "Project" menu
then choose Settings.
In the "General" tab you will see that you project isn't currrently using MFC. You can choose to use MFC in a static LIBRARY or in a DLL. I f you choose to have it in a library you'll have to include these files in stdafx.h
:
#include // MFC core and standard components
#include // MFC extensions
#include // MFC Automation classes
#include // MFC support for Internet Explorer 4 #include #include // MFC support for Windows Common
I haven't used MFC in a dll and I don't know if you have to include them there but i know that you won't have to carry all those DLL's if you want to check your app on a computer without VC++ installed
gabby
|
|
|
|
|
Here's the code...
<br />
void CProgramView::OnGotoButton(CString Param) <br />
{<br />
int ndex;<br />
CString Str, Url;<br />
<br />
if (Param.IsEmpty())<br />
{<br />
ndex = m_ListBox.GetCurSel();<br />
if (ndex == LB_ERR)<br />
{<br />
MessageBox("No Selection", "Program", MB_OK|MB_ICONERROR);<br />
return;<br />
}<br />
m_ListBox.GetText(ndex, Str);<br />
Url = ProgramUrl + Str.Left(10);<br />
}<br />
else<br />
Url = Param;<br />
<br />
ShellExecute(NULL, "open", Url, NULL, NULL, SW_SHOW);<br />
}<br />
And here is the assertion error...
Debug Assertion Failed
Program: ...\Program.exe
File: dbgheap.c
Line: 1044
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion... blah, blah, blah.
ShellExecute works... the assertion happens after IE is opened. I have no idea what's causing this.
Thanks!
Daniel
|
|
|
|
|
Copied from dbgheap.c starting at line 1039:
_ASSERTE(_CrtIsValidHeapPointer(pUserData));
Are you trying to delete a pointer that was never assigned with new , or trying to delete it twice? or maybe the pointer was assigned in a DLL and you are trying to delete it in you app?
Try to do a stack trace and see where in your code the error occured. (Alt-F7 in VC6, Ctrl-Alt-C in VC7)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
i want to make a printer driver that captures the printed data in a tiff and stores it in a specific location. - something like print to file
anybody can give me some hints on how to get this on the road ?
|
|
|
|
|
|
ya..that is little-bit difficult but can be done..
use DDK to make driver & so some basic study needed for ddk.
then
next step would be to create a pipe (server & client).
The main thing to note is server would be in your in your application & client in driver dll. when your application start then means pip server start then it'll allow user to get operation from printer driver. then server would take bitmap form data from printer driver & make a tiff file from that..
How to make bitmap to tiff...this can be checked from my article in code project.
that's it.. little difficult but possible to do..i think
OK! Good Bye..best of luck;)
Never consider anything Impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Hi
I have written this simple console application that prints a given maths time table, in this case - 12x table.
<br />
#include <iostream.h><br />
<br />
class CMathsTable<br />
{<br />
private:<br />
public:<br />
void PrintTable(int TimesTable)<br />
{<br />
int x = 0;<br />
int y = 0;<br />
int z = 0;<br />
int result;<br />
<br />
while(z < 12)<br />
{<br />
z++;<br />
<br />
x = TimesTable;<br />
y = z;<br />
<br />
result = x * y;<br />
<br />
cout << x; cout << " * "; cout << y; cout << " = ";<br />
cout << result << endl;<br />
}<br />
}<br />
};<br />
<br />
int main()<br />
{<br />
CMathsTable Maths;<br />
<br />
Maths.PrintTable(12);<br />
<br />
return 0;<br />
}<br />
How could I display this applications generated time table in a properly formatted table (i.e. columns and rows)?
A step in the right direction would very well appreciated.
Shuaib Latif
|
|
|
|
|
You have to #include <iomanip> and use the setfill() and setw() members.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
In the code editor in vs.net,there is a tree on the left,from which we can expand to show a function with all code, or collapse just to show the name of the function. How to implement this using MFC? Any ideas?
Thank you all!
Alick
|
|
|
|
|
|
Thank you very much.
I'm glad to do so
Alick
|
|
|
|
|
Hi.
Is there a way to override/redefine the maximum number of threads that can be created by an individual application running on XP.
I do not particulary want to redesign my application around thread pools, I just want to know if the default maximum number: 64 on my system, can be increased.
Best regards.
James.
|
|
|
|
|
What makes you think 64 is the maximum?
|
|
|
|
|
Because in WINNT.H MAXIMUM_WAIT_OBJECTS is defined as 64. If i create a 65th thread, WaitForMultipleObjects()
returns with a -1.
|
|
|
|
|
Laing,James wrote:
Is there a way to override/redefine the maximum number of threads that can be created by an individual application running on XP
A process can easily create more than 64 threads (just look at Task Manager on a busy server). It's true that MAXIMUM_WAIT_OBJECTS defines the maximum number of handles in the array passed in to WaitForMultipleObjects , but MAXIMUM_WAIT_OBJECTS is not related to how many threads a process can create, which was your original question.
Laing,James wrote:
I do not particulary want to redesign my application around thread pools
Are you actually using thread pools? It sounds like you are, since passing thread handles into WaitForMutlipleObjects is a standard way to implement them. If you are, and you want a to wait on more than 64 threads at one time, rather than create more than 64 threads, I would suggest splitting the array of handles passed in to WaitForMultipleObjects into several smaller arrays (64 or less handles each), and making several calls to WaitForMultipleObjects , one after the other, one for each array.
|
|
|
|
|
Thanks for the update.
My application creates a new thread as required, so the number maybe considerably more than 64.
I had not thought of simply splitting the array of handles.
Thanks for the help.
|
|
|
|
|
I want to capture the entire screen with DirectX 8 or 9?
And the performance will not too bad.
Who could help me ?
Thanks!! ^^
|
|
|
|
|
Hi there!
I am creating a custom control in MFC, which, when finished, should be something like a Command Prompt. I have ruled out the possibility of using a standard CEdit control as I need loads of different features which can only be accomplished by using a customized control.
It already is working fairly well: it outputs the character input by the user; it performs backspace action (with validation); and some other (very basic) features.
This is my first time creating custom controls in MFC and as you may have figured out by now, I am having some problems. So here it is:
- Obviously enough the Control must have keyboard input but whenever it has the focus and a key is pressed, a beep is sounded as if the control is not supposed to accept keyboard input. Why? Is it not correctly setup? How can I workaround this?
- Also, the only way I can get access to the keyboard input is by listening to the OnKeyDown message as OnChar doesn't work for some reason. Is this normal? Moreover, the keyboard input I get is based on virtual keys and not on the Keys themselves. Can someone tell me the best way to get the actual input char (upper/lower/plus flags)?
- Finally, whenever the control receives the focus, the event handler tries to show the caret (which was previously created), but it just doesn't show up. Again, is this occurring due to lack of proper setup?
Thank you for taking the time to read through.
Any help is greatly appreciated.
David
dNimrod#X
________________________
|
|
|
|
|
dNimrod#X wrote:
Obviously enough the Control must have keyboard input but...
Second time this has come up during the last days. Handle WM_GETDLGCODE , returning DLGC_WANTALLKEYS .
dNimrod#X wrote:
Also, the only way I can get access to the keyboard...
It might very well be. You haven't stated what type of control you derive from. WM_CHAR is sent as a result of a WM_KEYDOWN in the message loop TranslateMessage . Seeing that you would like to get the actual key pressed, the OnKeyDown -handler is more "low-level" than OnChar , so this should not pose any problem for you? As for the physical key, you don't want it. The VK_- codes will among other things guarantee that some other input-device emulating a keyboard can "fake" keys, which is a Good Thing. You have 8 bits (if memory serves) of "OEM scan code" in the input param flag, which ought to indicate the physical key, if you must have it. There is also GetAsyncKeyState if you want to check the state of other keys. Beware, this function will have to be called twice, the first time to clear some state (you might want to search MSDN for GetAsyncKeyState for more info on this).
dNimrod#X wrote:
Finally, whenever the control receives the focus,
Never shown? There are a lot of restrictions governing a caret, it has to be shown the same amount of time it has been hidden, the position has to be set etc. etc. etc. Have you tried the caret with a normal CEdit to begin with?
While you are to be commended on this brave endeavor, be prepared that it is not easy if you want to add stuff such as selection, copy and cut etc. Personally, I would have used a normal CEdit embedded in a larger CWnd -derived control.
|
|
|
|