|
Dear All
Hi
I want to use a grid control in one visual C++ 6 application.
May you please help me if you have any example.
Regards
Monhi
|
|
|
|
|
Does this help?
http://www.codeproject.com/library/gridprojects.asp
|
|
|
|
|
If I have 2 windows on my computer - on drive C: and drive D:.
I want to run my application from drive C: ,and access to registry on Drive D:
How can i achive this ?
THANK YOU VERY MUCH
|
|
|
|
|
I'm not sure if you are able to do this, but the registry files are stored in [Windows Root Drive]\Windows\System32\config\ from Windows 2000 and later.. If you are running the windows installation to which these files are owned by, you cannot open them, as they are being protected (and used) by kernel32.dll, however if you are running the application using a different installation of Windows, then you should be able to access them, provided you have read access to the registry files.. The registry files are Software, System, SAM, Security, Default, and UserDiff (none of these files have extensions). They all relate to different parts of the registry.
Look at this article for more info.
Good luck! Hope this helps!
--PerspX
|
|
|
|
|
I want to convert a .mid file to .wav file usin MFC... so need code for it or logic behind it...
jd
|
|
|
|
|
hi there,
I want to redirect my buffer data which is the contents of a .mid file to the sound card and then save sound card output as .wave file....
If anybody know how to perform this operation and the functions provided for this in VC++/MFC then kindly help me...
Thanking You....
|
|
|
|
|
I want to make a vector that holds function pointers. I can't seem to make the vector happy when defining it unless I define the function pointer using typedef first. Example:
<br />
typedef void (*BasicObjectListener)( BasicObject *object );<br />
std::vector<BasicObjectListener> EnabledChanged;<br />
But if I call the follow public function from another class it isn't able to convert the functoin pointer I want to pass to a "BasicObjectListener", though the function I'm passing is the same as a "BasicObjectListener".
<br />
void BasicObject::Enabled_AddListener( BasicObjectListener function )<br />
{<br />
EnabledChanged.push_back( function );<br />
};<br />
So I'm currently trying to find a way to define the vector without using typedef because then I can replace all the "BasicObjectListener"s with the function pointer code.
Help me
|
|
|
|
|
0rigin wrote: But if I call the follow public function from another class it isn't able to convert the functoin pointer I want to pass to a "BasicObjectListener", though the function I'm passing is the same as a "BasicObjectListener".
If the function pointed to is a class member function (method) then that method needs to be
declared static if it's going to match your BasicObjectListener type.
Otherwise, it should work fine.
Mark
"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski
|
|
|
|
|
Ok, I flopped some code around and what you described does in fact work, but I'm looking for something else. Since a static function is shared by all instances of a class it defeats the purpose of what I'm trying to accomplish.
I need to be able to call a dynamic list of function pointers without a type requirement. So for the code I gave in my first post, I want to essentially register ("Add a Listener") to a specific objects attribute and when that attribute gets changed through an Set function notify everyone who registered with that attribute of its change.
Got any nuggets of wisdom to point me in the right direction?
|
|
|
|
|
0rigin wrote: I need to be able to call a dynamic list of function pointers without a type requirement
This is tough because C++ is a strongly typed language.
You can keep a vector of member function pointers but to call those functions through the
pointers you'll need an object of the class the function is a member of.
That means you'll also need to store objects to make the calls on (i.e. "registrants" also need
to register an object along with the function pointer).
If the objects are all the same class (or a class derived from a common class) then one function
pointer typedef could be used, like you're doing.
If the objects are all different class types then you'd need to have separate typedefs for all the
separate member function pointers.
I don't know if those are "nuggets of wisdom"
Mark
"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski
|
|
|
|
|
Sounds like the problem I had a little while ago... so I implemented a callback wrapper class with virtual functions to accomplish this. See the tutorial on functors in the function pointer tutorials.
|
|
|
|
|
Thanks for your help guys,
I'm already on my way to implementing functors.
Thanks,
0rigin
|
|
|
|
|
A word of caution: your classes must not go out of scope before accessing the callback stored by the functor related to the class, otherwise, you will get undefined behavior (most likely an access violation exception). This is why functors are best used with either singleton classes. You should not retain the functor past the scope of the class object that the functor uses.
Other than that, if you get stuck anywhere, feel free to ask.
|
|
|
|
|
Hi,
I've just written a tiny little console app- 8.0KB in release mode and knocked together a deployment project for it, standard MSI installer- release mode size 1.9MB! It's packaging the VC8 CRT, fair enough, but why so large? Any ideas anyone? It's not normally a problem but I need the installer to be as nimble as possible.
Thanks in advance,
dave
|
|
|
|
|
Build your app with static linking, it will grow by the parts of MFC and the CRT that you use, instead of requiring you to ship all of them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
Thanks for the info- just a quickie, does this mean just make sure msvcrt8.lib is set in the linker dependencies and ignore all default libraries is checked? or is there a compiler option that'll handle it for me?
thanks again,
dave
|
|
|
|
|
There's a setting in your project properties -
Configuration Properties/C++/Code Generation/Runtime Library
where you can choose one of the non-DLL versions of the CRT.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hello,
I started to develop an application with MFC, using Document/views and OCX components, My application works fine but I just realized (and hope it not too late) that I need a same feature as reflection provided by .NET.
So my question is should I throw my application into the bean and develop a new one with C# or managed C++ or can I use my application by mixing MFC and managed C++ .
Or probably is there something else existing for unmanaged C++ that provides the same features as reflection.
Actually what I need to do is to dynamically access to the member functions and member variables of my application by their name.
For example I would like to type in the name of a function from an edit control to call that function.
You will probably suggest me to map the functions and data types but frankly I think it is not elegant. Of course this solution could be considered if nothing else is better.
Please what do you suggest me to do?
|
|
|
|
|
One option would be to COM-ize the classes/functions that need to be available to your application, and let them implement IDispatch. Then you have GetIdsOfNames and Invoke.
Hope this helps,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Thanks for proposing this solution.
I am 100% newbee with COM, so where do you suggest me to start? a good book or just to search some articles in code project?
Does Invoke mean that I will be able to call the function on runtime by typing in its name and parameters from an edit control?
|
|
|
|
|
Arris7 wrote: Does Invoke mean that I will be able to call the function on runtime by typing in its name and parameters from an edit control?
Yes, if you already have a IDispatch pointer to an object which implements the functions you want to call, then you can first call GetIdsOfNames to get the DISPID of the function, then use Invoke to call a function with a given DISPID. This is how it is done the hard way (pure C++), but you could also use scripting mechanics which take care of all this. One article which talks about similar things is this one: http://www.codeproject.com/com/scripter.asp[^], you can surely find other similar.
Hope this helps,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hoe to convet a .mid file into .wav file using VC++/MFC? need functionality......
|
|
|
|
|
Hello,
I'm looking for an API function to get the CPU load (or a method to do this based on several API functions).
I recently bought a dual core processor and the minimized task manager isn't very helpful with providing quick information as to how each core is used. After digging a little on the net I decided I would be nice to write my own utility, but got stuck.
Any ideas how to do this? Any existing apps worth installing?
Many thanks,
Miron Brezuleanu
|
|
|
|
|
You need to use the performance counters. See PdhOpenQuery for how to get started with the Performance Data Helper APIs.
|
|
|
|
|
#include <iostream>
#include <string>
void println(const std::string& msg)
{ std::cout << msg << '\n'; }
class Base {
public:
Base() { println("Base::Base()"); virt(); }
virtual void virt() { println("Base::virt()"); }
};
class Derived : public Base {
public:
Derived() { println("Derived::Derived()"); virt(); }
virtual void virt() { println("Derived::virt()"); }
};
int main()
{
Derived d;
...
}
Why does the virtual virt function is called on the base class and not on derived class?
|
|
|
|