|
I read the article... Thanks...
|
|
|
|
|
Moak could be right, task manager may show not only the program size but linked DLLs etc..
You make sure, the memory size means runtime memory shown by task manager or just the exe file size.
Whats the exe file size?
Best Regards,
Suman
btw, my vc 2005 trial version has been expired, so I could not try, just telling ideas
|
|
|
|
|
It doesn't matter... I was put on certain constraints... I have to enforce them...
Maybe I can remove dependencies from my app...(?)
According to previous posts, it should affact the MemUsage column...
|
|
|
|
|
Hi,
All the best to solve the problem!!
Please let me know when you find solution
Best Regards,
Suman
|
|
|
|
|
Shy Agam wrote: I was put on certain constraints... I have to enforce them...
That's all well and good, but you must use the right tool to measure with. Task Manager is not that tool.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello All,
How to get present Date Time in MFC application?
Thanks
|
|
|
|
|
CTime::GetCurrentTime() [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks, GetCurrentTime() works but the function does not show up in the member list.
|
|
|
|
|
Sushma K wrote: but the function does not show up in the member list.
Why bother about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Delete *.ncb files from your project folder.
Regards,
Paresh.
|
|
|
|
|
|
Hi,
I writting a C++/DLL interface to a C/DLL
I export this function in the C++ DLL and import it in the C DLL
The problem, I am passing The C++ DLL function 3 paramters
The First thing I do in this function is Build a C++ object
via new function/method (hope I using the the right
terminalogy)
What happens my second parm in the fuction gets overlaid
With the size of the object as that is (I guess the first parm to
the the new method/function)
How do I know this?? I step thru this in disassembly mode
example of what I am taking about
objptr is declared in Global storage above DLLMAIN
if that make a difference
__declspec(export) cplusplus(char *a, int b, int c)
{
objptr = new OBJECT(a,b,c);
|
|
|
|
|
As far as I could understand you have problems with argument values of your exported/imported function...
Anyway, I see a problem here; you should declare your function as extern "C" when both exporting and importing it (to overcome differences between C and C++ when calling the same function in both)
Your example should be:
extern "C" __declspec(export) cplusplus(char *a, int b, int c)
{
--
=====
Arman
|
|
|
|
|
in my declaration of the fuction I am
However in the actual code do I need to preface the function with extern "C" too ???
Thankx
|
|
|
|
|
Yes (I think you mean the definition by saying 'actual code'). Something like so;
// mydll.h
extern "C" __declspec(dllexport) int myFunc();
// mydll.cpp
extern "C" __declspec(dllexport) int myFunc()
{
// the body
}
// Inside the client..
extern "C" __declspec(dllimport) int myFunc();
--
=====
Arman
|
|
|
|
|
I think that (extern "C") and the fact that I was using LOCAL variables between calls to the exported functions might have been the problem (as it now works). Let me explains what I mean by the former
What I had was the follwing
#define MYEXPORT extern "C"
MYEXPORT int a(int c) <--- call DLL export func a
{
int b
.
.
.
return b
}
MYEXPORT int d(int b) <--- Call DLL export function d
{
.
.
.
.
return
Since since "b" was a local variable in a {defined on the stack after the input and output variables
it is storage are is not perserved between Calls
What I did was declare b as "static" I think then b's storage area gets declared in a different area as a Global variable maybe off the the Data Segment register
Anyway this seemed to make it work
Let me know if any of whay I am saying makes sense
Thankx
|
|
|
|
|
Hi All,
I have generated a tlb file through idl for the implementation of COM.
I want to use this COM object in my VC++ code.
Anybody know how to reference tlb file in VC++ code.
For VB I can directly reference the tlb file, but I dont dont know is there any way we can reference tlb file in my VC++ code and start using the methods inside COM object
Thanks in Advance
JK
Reply·
|
|
|
|
|
Using .tlb in C++ is not so straightforward as in VB, but possible.
Generally, the following example may guide you how to use type libraries in VC++;
#import "MyPath\MyTypeLib.tlb" rename_namespace("SmthLooksMeNice") using namespace SmthLooksMeNice;
#include <objbase.h>
int main()
{
CoInitialize(NULL);
IMyComObjectPtr pObject(_uuidof(MyComObjectName));
BSTR temp = pObject->SomeProp;
pObject->DoSmth();
CoUninitialize();
return 0;
}
--
=====
Arman
|
|
|
|
|
Hi Arman,
Thanks for the sample code
I did import my tlb file with rename_namespace("MYNAMESPACE") option
I got following two compilation errors
1) error C2664: '_com_issue_errorex' : cannot convert parameter 2 from MYNAMESPACE::MYCLASS *const ' to 'IUnknown *'
2) error C2504: 'AnyObject' : base class undefined
I tried import using following command
#import "C:\temp\Mytlb.tlb" rename_namespace("MYNAMESPACE") raw_interface_only
The first compliation error went off but the second error
error C2504: 'AnyObject' : base class undefined
still exists.
When I see my tlh file my class is deriving from AnyObject base class.
I am not sure why it is deriving from AnyObject?
Is there any base class called "AnyObject" in C++? If yes what are the include files i need to include? Please help me.
Thanks in advance.
Regards
JK
|
|
|
|
|
Hi Arman,
I found out the solution for error C2504: 'AnyObject' : base class undefined
My tlb is dependent on some other tlb so, what i did is I #import the base tlb before importing my tlb. It complies fine. There are no errors.
But, I am not able to get pointer to my COM object, when I am running following sample code
CoInitialize(NULL);
IMyComObject pObject(_uuidof(MyComObjectName));
I am getting following error in CoCreateInstance method
0x80040154 Class Not Registered
I checked the registry, there is an entry for my typelib.
I am not sure why it is not able find the class.
Any suggestions/help please..
Thanks in advance
JK
|
|
|
|
|
Is it possible to use resources with subclassed controls? If so, how? After creating a control with hControl = CreateWindow( ... ), is there a function I can call that will use a resource to format it (or a different function to use besides CreateWindow)? I only know how to use resources with menus and dialog boxes at this point. I've looked through many examples and I've tried many searches, but I've yet to see this done. As such, I'm asking the question here.
|
|
|
|
|
I'm not sure what you mean here.
Have you subclassed an existing Windows common control or do you have your own window class,
which isn't a subclass?
And by resources, do you mean a custom control on a dialog resource?
Assuming you do mean a control on a dialog resource...
For a subclassed Windows common control, you use the common control class on the dialog and
subclass it after the dialog is created, which is the only time you can subclass it - when the control actually exists.
For a custom window/control class on a dialog, you can place a "Custom Control" (from the toolbox in the dialog editor)
on the dialog. Then in its properties, set the appropriate values, especially the window class. This window class will need
to be registered when you create the dialog or dialog creation will fail.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I'm not sure what you mean here.
I think he means like he want's a filet-o-fish with no special sauce.
led mike
|
|
|
|
|
Hmm... After doing some more research, perhaps a more relevant question would be: Is there a UI for organizing the main window? As in, the window that pops up in a basic Win32 Application, and not a dialog box.
I don't need help creating dialog boxes, as those are relatively easy. However, inserting controls in the main window is more difficult. I'd like a way to organize this main window with a resource file (.rc) or just a UI in general. Right now, I'm coding everything by hand, which is fine, but I was wondering if there was an easier way to do this.
As you can probably imagine by now, I'm quite new to programming Win32 applications. I don't really like popups, but dialog boxes are much easier to make, so right now I'm considering making my application just open a dialog box that looks exactly like a regular window, though I don't know if this would be particularly easy, either. The best-case scenario would be an easier interface for editing the main window, which I've yet to find in VC++ (I'm using 2008 Pro).
|
|
|
|
|
I don't know of any UI tools for laying out child windows on a parent window.
If a dialog window suits your needs, you don't have to use a popup-style dialog.
You can make a dialog resource which is a borderless, child style and position it
within the client area of a regular window, which can be any style you want.
In the window containing the dialog, you could create the chhild dialog (modeless) in response to the
WM_CREATE message. In response to WM_ERASEBKGND you would do nothing (making the window "transparent"
and preventing flicker. In response to WM_SIZE, position/resize the child dialog to fit the entire client area of
the window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|