Hi,
I'm developing an add-in for Visual Studio which works like Quick Watch in debug mode for viewing
datasets/datatables as tables.
I already have a working add-in, but there is one problem i can't find solution for:
When i select a dataset object and from context menu choose "DSWatch" (my add-in), it shows
correctly, but i need to add functionality to just put cursor on the variable instead of electing it.
What i have is:
public class Connect : Object, Extensibility.I DTExtensibility 2, IDTCommandTarge t,ICallback
{
public void Exec(string commandName, EnvDTE.vsComman dExecOption executeOption, ref object varIn, ref
object varOut, ref bool handled)
{
string str="";
DatasetWatchFrm _DatasetWatchFr m = null;
try
{
EnvDTE.Debugger debugger;
debugger = applicationObje ct.Debugger;
applicationObje ct.ActiveDocume nt.MarkText;
TextSelection _TextSelection;
applicationObje ct.ActiveDocume nt._TextSelecti on =
(TextSelection) applicationObje ct.ActiveDocume nt.Selection;
str=_TextSelect ion.Text ;
if ( commandName != "DSWatch.Connec t.DSWatchNode")
{
m_bDataTable = true;
}
_DatasetWatchFr m =new DatasetWatchFrm (str);
string strValue = this.GetExp(str );
_DatasetWatchFr m.m_strValue = strValue;
_DatasetWatchFr m.SetParent(thi s);
_DatasetWatchFr m.getXml(strVal ue);
_DatasetWatchFr m.Show();
}
catch(Exception e)
{
_DatasetWatchFr m.Show();
System.Windows. Forms.MessageBo x.Show(e.Messag e );
}
}
}
So i can get the selected text from IDE and then get the dataset itself,\but how do i get the text
under cursor?
Any suggestions would be highly appreciated!
Thank you in advance,
Andrey 5 3637
To get the text under the cursor, even if there is no selected text, you use
TextSelection.A ctivePoint, create an EditPoint and then get the text with
EditPoint.GetTe xt or EditPoint.GetLi nes. You will have to parse the text to
the left and to the right until finding a blank character.
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster. http://www.mztools.com
"MuZZy" <le*******@yaho o.com> escribio en el mensaje
news:b-*************** *****@comcast.c om... Hi,
I'm developing an add-in for Visual Studio which works like Quick Watch in debug mode for viewing datasets/datatables as tables.
I already have a working add-in, but there is one problem i can't find solution for:
When i select a dataset object and from context menu choose "DSWatch" (my add-in), it shows correctly, but i need to add functionality to just put cursor on the variable instead of electing it.
What i have is:
public class Connect : Object, Extensibility.I DTExtensibility 2, IDTCommandTarge t,ICallback {
public void Exec(string commandName, EnvDTE.vsComman dExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { string str=""; DatasetWatchFrm _DatasetWatchFr m = null; try { EnvDTE.Debugger debugger; debugger = applicationObje ct.Debugger; applicationObje ct.ActiveDocume nt.MarkText;
TextSelection _TextSelection; applicationObje ct.ActiveDocume nt._TextSelecti on = (TextSelection) applicationObje ct.ActiveDocume nt.Selection; str=_TextSelect ion.Text ;
if ( commandName != "DSWatch.Connec t.DSWatchNode") { m_bDataTable = true; }
_DatasetWatchFr m =new DatasetWatchFrm (str); string strValue = this.GetExp(str ); _DatasetWatchFr m.m_strValue = strValue; _DatasetWatchFr m.SetParent(thi s); _DatasetWatchFr m.getXml(strVal ue); _DatasetWatchFr m.Show(); } catch(Exception e) { _DatasetWatchFr m.Show(); System.Windows. Forms.MessageBo x.Show(e.Messag e ); } }
}
So i can get the selected text from IDE and then get the dataset itself,\but how do i get the text under cursor?
Any suggestions would be highly appreciated!
Thank you in advance, Andrey
Carlos J. Quintero [.NET MVP] wrote: To get the text under the cursor, even if there is no selected text, you use TextSelection.A ctivePoint, create an EditPoint and then get the text with EditPoint.GetTe xt or EditPoint.GetLi nes. You will have to parse the text to the left and to the right until finding a blank character.
Thanks a lot! I will give it a try!
By the way, do you know any good tutorial/website dedicated to creating debugger add-ins?
Thank you
Andrey
Carlos J. Quintero [.NET MVP] wrote: To get the text under the cursor, even if there is no selected text, you use TextSelection.A ctivePoint, create an EditPoint and then get the text with EditPoint.GetTe xt or EditPoint.GetLi nes. You will have to parse the text to the left and to the right until finding a blank character.
If i use EditPoint.GetTe xt, i need to specify number of characters.
So do i just set a big number of characters?
Like:
string strBefore = EditPoint.GetTe xt(-100);
string strAfter = EditPoint.GetTe xt(100);
and then look for space in strBefore starting from end and in strAfter starting from start?
Is it the right way?
Also, for c++ document case, should i include '->' or shoud i replace them by '.'?
Thanks a lot!
Andrey
Not specific to debugger add-ins, but on my web page you have most (all?)
resources about .NET add-ins: http://www.mztools.com/resources_addin_developers.htm
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster. http://www.mztools.com
"MuZZy" <le*******@yaho o.com> escribio en el mensaje
news:6I******** ************@co mcast.com... By the way, do you know any good tutorial/website dedicated to creating debugger add-ins?
In my add-in I am using EditPoint.GetLi nes() with a line count of 1, rather
than GetText. So, I get the whole line of the cursor. Since I know the
column of cursor in that line, I can move to the right and to the left until
I find a blank character.
My C++ is rusty, but I think that "." was for structures and for classes
"p->f" was a shortcut for (*p).f . Ask in the C++ newsgroups or try and the
compiler will tell you if the syntax is wrong.
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster. http://www.mztools.com
"MuZZy" <le*******@yaho o.com> escribio en el mensaje
news:OM******** ************@co mcast.com... If i use EditPoint.GetTe xt, i need to specify number of characters. So do i just set a big number of characters? Like:
string strBefore = EditPoint.GetTe xt(-100); string strAfter = EditPoint.GetTe xt(100);
and then look for space in strBefore starting from end and in strAfter starting from start? Is it the right way?
Also, for c++ document case, should i include '->' or shoud i replace them by '.'?
Thanks a lot! Andrey This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Paul Faulstich |
last post by:
How can one exit the debugger with a non-zero return code?
My perl script is called from another program which checks the return
code. When I run it through the perl debugger, the debugger exits
with a zero for its return code even if my script calls exit with a
non-zero value. How can I pass the value from my script on when I
quit from the debugger?
Thanks,
|
by: cyaron |
last post by:
Hi,
I would like to ask for your help
I would like to download debugger for javascript.
Since I works only with IE I thought of trying using the Microsoft Script
Debugger.
I found the following URL
|
by: alonzo |
last post by:
I am working on a piece of javaScript code and using MIE 6.0. I have and
error and I would like to use a debugger to locate the error. Is there a
debugger for MIE? How do I turn the debugger on for MIE? Where can I
locate the debugger for MEI 6.0? I am using WIN 98 operating system.
|
by: Raquel |
last post by:
UDB PE 8.1.3 on XP. Have IBM Distributed Debugger installed on my
machine. When I invoke the debugger with the command: idebug, the
debugger gets loaded and I am able to debug my Java stored procedure
just fine.
However, when I try to Debug the stored procedure through Development
Center (After invoking "Build for Debug"), it does not seem to invoke
the Distributed Debugger. It just gives a message : Debug Started and
then just runs the...
|
by: Andrew Burlak |
last post by:
When I add 'foo' to Watch, it has the value
0x000000009abcdef0
although the program output is correct.
Configuration: Debug, Win32 Console.
-----
#include <stdio.h>
__int64 const foo = 0x123456789ABCDEF0I64;
| |
by: Stu Cotts |
last post by:
VS 2003
Using vc++
I add into a function the following code
bool testa;
testa = true;
The debugger will not show values for any of the elements and
|
by: Rafael Tejera |
last post by:
I'm receiving this error when trying to run a C#2003 ASP.NEt application.
The error is the following:
Error while trying to run project: Unable to start debugging on the web server. You do not have permissions to debug the server.
Verify that you are a member of the 'Debugger Users' group on the server.
I had add almost all my users inside this group, but the problem persist.
|
by: edwardzyang |
last post by:
I am running Windows XP with cygwin with gcc 3.4.4-1 and gdb
20060706-2. I compiled this very simple program:
#include <iostream>
using namespace std;
int main(int argc, char (*(argv)) ) {
int max; // number to count to
if (argc == 1) {
// print to 100
|
by: =?Utf-8?B?V0o=?= |
last post by:
I have a VC++ application that just crashes on one tester/client's machine.
It runs fine everywhere else.
What are the other options to debug (on the client's machine) without
installing VC++ (on the clinet's machine)? Is this possible at all? Thanks.
WJ
|
by: cmdolcet69 |
last post by:
I have the fololwing code, it is simple yet the flag will never be hit
for some odd reason
Dim STRdata as string
Dim setRedFlag as boolean
If STRdata = "" then
setRedFlag = true
end if
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |