|
Check out the MSDN documentation for IActiveScript . This is how most apps do it I believe. It requires that you make all your 'scriptable' objects into COM objects. IActiveScript supports JavaScript and VBScript among others (actually it supports whatever script engine you have installed)
Also check out IActiveScriptParse, which is the easiest place to start.
|
|
|
|
|
I am really desesperate! I stop in this problem 1 month ago!
I must scroll another window the same horizontal pixels amount. I receive EN_HSCROLL notifications but the informaton provided by GetScrollInfo() is meaningless.
Could anybody help me?
Miguel Fonseca
miguel.fonseca@xerus.pt
|
|
|
|
|
I have been using the memory watch window a lot lately when debugging and it leaves a lot to be desired. I'd really like to be able to watch more than one memory location at a time, and to get wide strings displayed properly, because I often look up XML which is in a _bstr_t. So I'd like to write my own memory watching tool to use while debugging. The question is, if I do this, as a seperate process, how can I view memory with impunity and not crash my app from trying to access memory I do not own ? Being able to write to it would be nice, but if all I can do is read, that would cover 99% of what I'd like to achieve.
Any hints ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Either make a module and recompile the kernel or use the IDebugger interface. (I've never used it myself, so an extensive article about it would be appreciated )
|
|
|
|
|
Could you tell me more ? IDebugger does not come up in MSDN.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
MSDN October 2000 wrote:
...
With the Debugger object, you can inspect the processes being debugged in Developer Studio.
...
The Debugger object implements the IDebugger dual interface. Through this interface, add-ins can directly access the members (properties, methods, and events) of this object and can employ early binding to make calls into these members faster at run time.
Add-ins written in Visual C++ can access members of the Debugger object by using the header files in Vc98\Include\objmodel. However, if you use the Developer Studio Add-in Wizard to create an add-in, the wizard automatically includes these header files in your source code.
...
I'll try to get some more info and get back.
|
|
|
|
|
There are a number of format codes that you can use in the normal watch window which may give you some of what you want.
For instance, if you know the address of a memory block that you want to view (for example, memory at 0x01f0000), you can enter in the watch window something like:
0x01f0000,m
This will display 16 bytes of memory at the location 0x1f0000.
ma = 64 ASCII characters
m = 16 bytes hex, followed by 16 ASCII
mb = 16 bytes hex, followed by 16 ASCII
mw = 8 words
md = 4 double words
mq = 2 quad words
mu = 2-byte characters (unicode)
In addition, su displays a unicode string.
You can get the rest of the watch window or Quick watch codes under "Symbols for Watch Variables"
Best regards,
John
|
|
|
|
|
Anyone knowns how to get the IGPEInformation interface?
Seems not to be implemented by any object.
Or, is my fear that I have to implement this interface right?
Vote against software patents in europe
|
|
|
|
|
Hi all,
I'm using the WinInet api to download a file from an ftp server which works fine. What does not work fine however is that when (for testing purposes) I kill the connection (both data and control channels) or shutdown the server FtpGetFile() does not return an error like it should.
I also tried to use FtpOpenFile() and InternetReadFile(). This method downloads files fine. However it displays the same probs: when i kill the connection, etc InternetReadFile returns TRUE.
In all cases both GetLastError and InternetGetLastResponseInfo are returning 0, i.e. no error.
Is there some way I can detect when a download has failed (either when using FtpGetFile or InternetReadFile) short of writing an ftp client or comparing the file sizes (a very inelegant solution).
10x for ur help
|
|
|
|
|
Me and my friend were having a discussion abt when a class can be called a wrapper class..
eg:
Class CA
{
void SenttoPort(char * tstr);
}
Class CB: Class CA
{
void SendFrame(char Header, char Tail, char Body);
}
void CB::SendFrame(char Header, char Tail, char Body)
{
// format the header tail and body into one string
// temp = header + body+tail
Sendtoport(temp);
}
My doubt is , if a class (CB) is derived from another class (CA), and uses the member function of the parent class (CA), in a member function of its own which accepts different parameteres depending upon the problem domain,(as in the function SendFrame()), can we call the class (CB) as a Wrapper Class of class CA.
Please answer this question and if you can't understand the prob I face please define as to when we can call a class a wrapper of another class.
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
In my understanding, a wrapper class is one that provides an emulation of the interface for one class, but using the code for another.
For example, back in the days that 3dfx graphics cards were popular, many people created "glide wrappers" which provided a dll with the same interface as the 3dfx graphics card libraries (called glide), but translated the calls into something that could run on a machine without a 3dfx card (opengl, directx, or the api functions for a different chipset)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
A wrapper class usually in my mind is a class that wraps existing functionality. For example, CDC is a wrapper class - it wraps the functionality we get using HDC's and Win32 API functions into a class object.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
So, can i take that, the class that encapsulates Win32 api in it is the only type of class that we can call a wrapper class...so if i derive a class that enhances the existing classes then it cannot be called as a wrapper class...!
is it true.....?
Thanks for ur interest
|
|
|
|
|
I don't know about that, but certainly if class B derives from class A, I would not call class B a wrapper class, no.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
As I understand it, a "wrapper" class is simply a way to put a new front-end on a piece of code. I have never seen a formal definition of it, so you can call it CB a wrapper if you really want.
A common situation is where a set of C functions (like the GDI example above) is wrapped by a very simple C++ class. Like a "wrapper" in real life, a wrapper class generally adds very little functionality to what it wraps (maybe some cleanup in the destructor, etc.). It's really just a grouping or packaging.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
You could name your example class as a "wrapper", but strictly speaking this is not what wrapper usually refers to in the design patterns literature. A wrapper (aka adaptor) is a class that conforms to a given interface using the services of another, non-related class that actually does the stuff. Here's an example. Consider the following interface (or abstract class in C++ terminlogy):
class stream
{
virtual void write(const char* data,size_t len)=0;
virtual size_t read(char * data,size_t len)=0;
}; Now suppose we got the following class for handling sockets:
class TCPsocket
{
void send(const char* data,size_t len);
void recv(const char* data,size_t len,size_t * read);
} You can see TCPsocket gives essentially the functionality required by stream , but the methods simply don't match. The following wrapper make the adjustments:
class TCPsocket_wrapper:public stream, private TCPsocket
{
void write(const char* data,size_t len)
{
send(data,len);
}
size_t read(char * data,size_t len)
{
size_t read;
recv(data,len,&read);
return read;
}
} The complexity of the adaptation could range from a simple forwarding to more elaborate rearrangements ot the arguments passed.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Dear Mr. lopez,
Thank you for your lucid description.
However, I have one small nagging issue that I need to sort out. I had defined the class CB to inherit from CA. (please refer the first link) In Cb I have mapped my send and write statements much like yours. I want to know if it is mandatory for a wrapper class, to inherit its interface from a abstract base class.
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
Well, this is just terminology. Actually, you can call a wrapper to whatever it seems a warpper to you. But if we stay within the limits of what this idiom is defined to be in the patterns literature, then a wrapper must inherit the abstract class it adapts the preexisting object to. The key idea behind wrappers is that they allow third party components (the wrapees) to be used in another environment (that defines the interface.) If you don't derive from an abstratc class (or implement an interface in Java), then your adatation can still be used but only as an isolated component, not within a more general framework dealing with multiple implementations of the same functionality.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've a question about this example: It opens excel and inserts an eventsink to catch the events inside excel.
HOWTO: Catch Microsoft Excel Application Events Using VC++ Q186427
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q186427
I've tried this example using an MFC-EXE, and all works fine. When you press start, the excel application shows up. Clicking with the mouse results in a event messagebox.
But, if you want to include this functionality inside an MFC-DLL, it will not work. Excel shows up alright, but when you click something or press a button, the excel application will block. After a while a messagebox shows up saying: "Microsoft Excel is waiting for another application to complete an OLE action."
Short: using a .exe works fine, but the .dll blocks.
Why?
What's the difference here? (I've used MFC in both cases)
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I may not be correct but just a guess here..
There is nothing to do with EXE or DLL But with SINK_ENTRY macro's
Microsoft accepts Event Sinking implementation (DispEventImpl) has bugs in ATL and MFC.
And i saw this hanging problem when the signature of the function varied. Just check automation parameters across the basic and supported native types.
For Ex:
SINK_ENTRY(1, OnButtonClick)
try
OnButtonClick(_bstr_t bstrparam1, _variant_t vtParam2)
vis-versa
OnButtonClick(BSTR bstrparam1, VARIANT vtParam2)
This should not be an issue if "raw_interfaces_only" is used with #import.
Thanks,
Ramu
|
|
|
|
|
mmm...
you are right, it has nothing to do with the exe-dll thing.
I'm pretty shure it's a thread problem.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I write those code :
...
#include <map>
using namespace std;
map<int,int> aMap;
...
many compile warnings occur: all of warnings are same. ( c4786 )
warning C4786: '?rbegin@?$_Tree@HU?$pair@HH@std@@U_Kfn@?$map@HHU?$less@H@std@@V?$allocator@H@2@@2@U?$less@H@2@V?$allocator@H@2@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$_Tree@HU?$pair@HH@st
d@@U_Kfn@?$map@HHU?$less@H@std@@V?$allocator@H@2@@2@U?$less@H@2@V?$allocator@H@2@@std@@U?$pair@HH@3@AAU43@PAU43@H@2@XZ' : identifier was truncated to '255' characters in the browser information
What can I do ? I use VC++ compile the code? thanks
|
|
|
|
|
The warning is quite silly. Either ignore it, or add a
#pragma warning(disable:4786)
before you use any parts of the map class.
|
|
|
|
|
|
Two solutions come to mind:
1- Put a pragma to disable the warning
2- switch to next version of VC++
Daniel
|
|
|
|
|