Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Sabotaged
Jul 6, 2004

I'm working on getting some IPC between a VC++ application and a console C# 2.0 application.


I'm having a problem on the C# side of things, though: I'm subclassing a System.Windows.Forms.Form, so I can override and listen to WndProc. The form isn't meant to be visible, I just need some way of receiving these WndProc messages.

However, when I try and start up the form class, I get a ComponentModel.Win32Exception: Error creating window handle.

code:
                    _window = new FormFoo();                    
                    _windowHandle = _window.Handle;
                    ....
                    Application.Run();
FormFoo is my subclassed form, and the line after that is the offending line. If I don't include the second line, I end up getting no messages in my WndProc method.

I must be missing something simple to setup the form, right?


EDIT: Okay, I realized what I was doing wrong: If you override WndProc, you need to make sure you call base.WndProc(ref message); at the end :downs:

Sabotaged fucked around with this message at 22:12 on Aug 31, 2007

Adbot
ADBOT LOVES YOU

Wizzle
Jun 7, 2004

Most
Parochial
Poster


nullfunction posted:

Smart Devices and creating .NET applications

GPRS function on a Smart Phone

Smart Device for all of our sales staff query the SQL server

GPRS when working from the field ... WiFi in our office How do I make my application aware of the connections that are active on the phone?

He mentioned using an ASP.NET page to do the database calls and return the data to the phone in XML form, ala AJAX. Does the .NET framework include the necessary libraries to take most of the legwork out of this for me?

Smart Device with an integrated barcode reader

I believe that a WiFi capable Smart Phone will automatically switch between GPRS and WiFi when it's in an area that has WiFi. You don't need to manage it from within your application. It's like in Windows when it would automatically dial your Internet connection when it needed to connect.

The .NET Compact Framework has a SQL Client built in. If you're going to use it over a public network, you'll want to encrypt it and use certificates for authentication. If you want to go the HTTP route, there's no sense in using AJAX. Just build a web service. SQL Server 2005 has that built in or you can do it from your web server very easily with ASP.NET.

For ruggedized Windows Mobile Barcode readers, I like Symbol. They're tough as hell and widely supported. I have a client who still has PALM III-based scanners in use and they're run by teenagers. If that doesn't speak to their reliability...

(*NOTE*) If you do set up a WiFi in your warehouse, contract with someone to set it up correctly who KNOWS wireless systems. They can come in, scope your environment, measure for interference and place the Access Points and Antennas accordingly to minimize cross-talk, interference, and god knows what else. Also, in the WiFi setup for the scanners enable CAM on the power setting feature. Just trust me on this. It will save you months of headache trying to figure out why pings are high and packets get dropped.

ProfCrazynuts
Feb 26, 2004
What's the difference between using data types like int vs Int, or string vs String? which one is preferred?

wwb
Aug 17, 2004

There is no difference AFAIK. The lower-case option is just some compiler magic catering to the java types. Personally, I use int and string because that was the way I learned and that seems to be the standard.

biznatchio
Mar 31, 2001


Buglord

wwb posted:

There is no difference AFAIK

Yep, there isn't. string = System.String, int = System.Int32, long = System.Int64, etc.

It's just syntactic sugar to save you from having to refer to those common types by a more complex name.

Wizzle
Jun 7, 2004

Most
Parochial
Poster


Has anyone ever used Reporting Services embedded in an application?

Basically, I want to store the RDL in the database itself. This way changes made will be available to users instantly. (Column Type XML)

I want the app to load the RDL (I assume this would be accomplished with a Stream), prompt for anything it needs to prompt for, then throw the report up on the screen. I don't want to do this with Crystal Reports (even though I have the Pro version of VS2005) because I don't want to have to push out the CR Runtime to the users as well.

I'm pretty sure this can be done, I'm just not too sure where to start.

In fact, when I click Add Item I don't see anything relating to reports that isn't Crystal.

Anyone have any experience on this they can share?

adante
Sep 18, 2003
I am new to this databinding stuff. Is there a way to use databinding with a DataGridView, but customize the columns which are displayed?

For instance I know if you
code:
DataGridView dgv;
IList<Foo> foolist;
...
dgv.DataSource = foolist;
it will display all the public properties of class Foo. But what if I want to omit some properties, or add other (derived) columns? How is this done?

For instance if Foo has a number of public functions int foox() and int fooy(), and I want a column which produces foox() + fooy(), how is this done?

Or am I completely thinking about things the wrong way? I have been searching for DataGridView tutorials for making custom column types with datasources but all I find is articles for overriding the onpaint method for existing columns, not defining new columns.

wwb
Aug 17, 2004

@Wizzle:

You don't see reports because the reports live in SQL server, not in your application. What you want to do is add a Reporting Services project to your solution. Then you use the reportviewer control to pull them into your UI.

Another option would be to serve up reports using SSRS web services, but that is probably overkill here.

@adante

Yes, that sort of thing is possible. First, you want to set AutoGenerateColumns to false to take care of the extraneous data issue.

Insofar as creating derived columns, that requires using TemplateColumns and databinding syntax. For example:

code:
<ItemTemplate>
   <%# ((foo)Container.DataItem).DoX() + ((foo)Container.DataItem).DoY() %>
</ItemTemplate>
Should get you what you need. Key concept here is that there is an object, Container.DataItem, which represents the current "row" of the data source. You need to cast it back to it's original form as appropriate and then you can call properties and methods straight away.

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

adante posted:

I am new to this databinding stuff. Is there a way to use databinding with a DataGridView, but customize the columns which are displayed?

For instance I know if you
code:
DataGridView dgv;
IList<Foo> foolist;
...
dgv.DataSource = foolist;
it will display all the public properties of class Foo. But what if I want to omit some properties, or add other (derived) columns? How is this done?

For instance if Foo has a number of public functions int foox() and int fooy(), and I want a column which produces foox() + fooy(), how is this done?

Or am I completely thinking about things the wrong way? I have been searching for DataGridView tutorials for making custom column types with datasources but all I find is articles for overriding the onpaint method for existing columns, not defining new columns.

wwb posted:

@adante

Yes, that sort of thing is possible. First, you want to set AutoGenerateColumns to false to take care of the extraneous data issue.

Insofar as creating derived columns, that requires using TemplateColumns and databinding syntax. For example:

code:
<ItemTemplate>
   <%# ((foo)Container.DataItem).DoX() + ((foo)Container.DataItem).DoY() %>
</ItemTemplate>
Should get you what you need. Key concept here is that there is an object, Container.DataItem, which represents the current "row" of the data source. You need to cast it back to it's original form as appropriate and then you can call properties and methods straight away.
Alternatively, if you have control over the Foo class and you aren't using it for anything except the DataGridView you can use the [Browsable(false)] attribute on any properties you wish to hide from the DataGridView and then also create a read only property like

code:
Public Class Foo
{
  //Other stuff...
  
  //property you don't want to show up
  [Browsable(false)]
  Public int FooHiddenColumn
  {
    //...
  }

  //new property for the DataGridView
  Public int FooSum
  {
    get { return foox() + fooy();}
  }
}
But, this is probably overkill and, as I said, it is dependent upon you having control over the Foo class.

Wizzle
Jun 7, 2004

Most
Parochial
Poster


wwb posted:

@Wizzle:

You don't see reports because the reports live in SQL server, not in your application. What you want to do is add a Reporting Services project to your solution. Then you use the reportviewer control to pull them into your UI.

Another option would be to serve up reports using SSRS web services, but that is probably overkill here.

I don't have the Business Intelligence Projects. I guess I need to install SQL2005 Developer Edition on my workstation.

wwb
Aug 17, 2004

^^^If you don't want Sql 2005 running on your workstation, you can just choose to install the client tools and the Business Intelligence Studio (which is really Visual Studio w/ Reports and analysis projects).

quote:

Alternatively, if you have control over the Foo class and you aren't using it for anything except the DataGridView you can use the [Browsable(false)] attribute on any properties you wish to hide from the DataGridView and then also create a read only property like

Technically valid, but really a bad design option in general. UI should not drive classes if at all possible, and databinding is easy enough once you get the hang of it.

Xycoth
Feb 2, 2004
Trog
I feel like I have a lack of understanding of something fairly basic when asking this question, but....

Background: Currently I am using a VB6 program to read in multiple text files and create an Access Database (or I guess maybe a data file is a better description? a .MDB file nontheless). Then I have a seperate program that accesses this database, and create a seperate .MDB file on its own.

Goal: Migrate to vb.net 2005 and get rid of all COM referrences.

Problem: The only way to programatically "create" a .MDB file in .NET is to include the ADODB COM referrence via the interop somethingorother.

I am not stuck on .MDB, but I cannot use something that tries to access data from a "database server". It basically must be a stand-alone datafile of some time, but I would like for it to keep the structure of some time of database (access, sql, oracle, xml, I really don't care, as long as it doesn't require any other software to "create"). What are my options here? I've been leaning towards making a sql database (I believe this would be a .mdk file?) but most everything I come accross points me towards needing a sql server. I started thinking about XML, but I'd need to make sure that the file wasn't accessible to the user, only to the program (i.e. I don't want the user to be able to open it and edit it from outside my program). Though I know people can open Access DB's, my .MDB file is pw protected (which I suppose could be cracked if they really wanted to).

Anyways, I feel like I'm rambling now. If anyone can help point me in the right direction, I'd be greatfull.

adante
Sep 18, 2003

wwb posted:

...
Insofar as creating derived columns, that requires using TemplateColumns and databinding syntax. For example:

code:
<ItemTemplate>
   <%# ((foo)Container.DataItem).DoX() + ((foo)Container.DataItem).DoY() %>
</ItemTemplate>
Should get you what you need. Key concept here is that there is an object, Container.DataItem, which represents the current "row" of the data source. You need to cast it back to it's original form as appropriate and then you can call properties and methods straight away.

thanks. I had a quick google for TemplateColumns and all the results seem to be ASP.NET centric. I should have specified that this is for the datagridview in visual studio winforms (maybe it is all part some microsoft grand unified presentation scheme, but if not, do equivalences exist for non asp .net? I haven't yet had a chance to look at this in more detail but I will when I get home.

Dromio
Oct 16, 2002
Sleeper

Xycoth posted:

I feel like I have a lack of understanding of something fairly basic when asking this question, but....
1. I don't know about creating a new MDB file, but I know you can access MDB files using the system.data.oledb namespace. Even better, you can use Microsoft's Enterprise Library for all your data access code, and then the config file will control what type of database you are connecting to.

2. I'd still be more inclined to use a SQL server for the data. Using SQL Express (which is included with VS.NET), you can specify a file-based connection.

In my app, I'm using SQL express to house the data, but coding it using the enterprise library so it's pretty to point it to a different data source if needed.

wwb
Aug 17, 2004

The real trick about having database agnostic code is writing database agnostic SQL. Which is very tricky for non-trivial applications.

Anyhow, I think your best bet here is to use Sql 2005 express combined with the file-type databases. You could just embed the create script in your app and call that when you need to create the DB. Users could still get to the data directly, but Sql 2005 does not ship with GUI tools so that is unlikely.

@adante

Sorry, that was very ASP.NET specific. I really know gently caress all about WinForms beyond the basics, so someone else will have to field your question here.

uncle vernon
Dec 7, 2003
I will not sass mods. I will not sass mods. I will not sass mods. I wi
I'm in the middle of a C# ASP.NET 2.0 project at work here. I'm pretty new to it.

My problem is that I'm supposed to move all of the C# code out of my .aspx file and into a .aspx.cs file that gets included with the Src="" directive. I had written it more like PHP with the code embedded in the HTML because that's what I'm used to.

Anyway, I got all of it moved except some literal print statements that I used to pass arrays to Javascript. Basically I have a string in my C# file that needs to be printed at a specific place inside the HTML file that includes it. Is there an ASP tag that translates to <script>, another way to do it, or am I screwed?

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat

uncle vernon posted:

I'm in the middle of a C# ASP.NET 2.0 project at work here. I'm pretty new to it.

My problem is that I'm supposed to move all of the C# code out of my .aspx file and into a .aspx.cs file that gets included with the Src="" directive. I had written it more like PHP with the code embedded in the HTML because that's what I'm used to.

Anyway, I got all of it moved except some literal print statements that I used to pass arrays to Javascript. Basically I have a string in my C# file that needs to be printed at a specific place inside the HTML file that includes it. Is there an ASP tag that translates to <script>, another way to do it, or am I screwed?

You can either do <%= MethodInYourCodeBehindThatReturnsTheStringOfJS() %> in your aspx, or output the whole js block via ClientScript.RegisterClientScriptBlock in your code behind.

uXs
May 3, 2005

Mark it zero!

havelock posted:

You can either do <%= MethodInYourCodeBehindThatReturnsTheStringOfJS() %> in your aspx, or output the whole js block via ClientScript.RegisterClientScriptBlock in your code behind.

Regardless of which method you use, I think it's a good idea to put the bulk of your javascript code in a separate .js file, and only put function calls in your aspx or aspx.cs files. Most examples on the internet seem to put all the javascript code in strings in the .cs file, which I think is a hilariously bad idea.

wwb
Aug 17, 2004

^^^Yes, for the actual core of the javascript functionality. But I think outputting local stuff, like say an array mapping some values to the ClientID property, makes sense.

Insofar as outputting a javascript array to a page, I would just use a repeater to generate the code if it makes sense to actually have it in the page.

Dromio
Oct 16, 2002
Sleeper
I'm trying to make a multi-select capable datagrid inside an UpdatePanel. I've got something like this:
code:
<asp:UpdatePanel ID="DataPanel" UpdateMode="Always" runat="server" >
    <ContentTemplate>
        <asp:GridView ID="DocumentGrid" runat="server" AutoGenerateColumns="false">
	<asp:TemplateField>
                <HeaderTemplate />
                <ItemTemplate>
                    <asp:CheckBox ID="chkSelect" runat="server" EnableViewState="true"/>
                </ItemTemplate>
            </asp:TemplateField>
	<!-- more fields-->
	</asp:GridView>
        <asp:Button ID="Approve" text="Approve Selected" runat="server" OnClick="approve_Click" />  
    </ContentTemplate>
</asp:UpdatePanel>
But when the approve_Click function runs, none of the checkboxes.Checked properties are true. I kind of understand WHY they aren't true, but I have no idea how I'd go about making sure their values are passed in the ajax call.

Anyone know how I could go about it?

Edit: nevermind. I was calling databind() during page.load. Doh

Dromio fucked around with this message at 19:43 on Sep 5, 2007

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:
If you do:
code:
namespace Test
{
    public class MyClass
    {
        private InternalClass ic = new InternalClass();
        
        public InternalClass MyIC
        {
           get { return ic; }
        }
    }

    internal class InternalClass : EventArgs
    {
    }
}
You get a compiler error due to inconsistent accessibility, which is understandable.
However if you do:
code:
namespace Test
{
    public delegate void TestEventHandler(object sender, InternalClass ic);

    public class MyClass
    {
        public event TestEventHandler TestEvent;

        private InternalClass ic = new InternalClass();

        public void Test()
        {
            if (TestEvent != null)
            {
                TestEvent(this, ic);
            }
        }
    }

    internal class InternalClass : EventArgs
    {
    }
}
It compiles just fine, why? InternalClass is still unaccessible, so registering an eventhandler should be impossible. Or is it possible to register a method that takes (e.g.) an EventArgs as parameter instead of an InternalClass?

biznatchio
Mar 31, 2001


Buglord

dwazegek posted:

It compiles just fine, why? InternalClass is still unaccessible, so registering an eventhandler should be impossible. Or is it possible to register a method that takes (e.g.) an EventArgs as parameter instead of an InternalClass?

This behavior is a bug in VS2005 and earlier. In VS2008, you can't expose a type that's less accessible than the delegate via its parameters.

biznatchio fucked around with this message at 15:18 on Sep 6, 2007

Just-In-Timeberlake
Aug 18, 2003
I don't even know if this is possible, I might be googling the wrong terms.

Is it possible to get the information in combo boxes/list boxes/text fields in a different application? Also, can you enumerate through the controls in another application?

I know you can get the selected text from a text box using SendMessage, so I suspect it might be possible, but the examples/documentation for SendMessage aren't that great.

Basically I need to get the information present on some POS software so my app can process it.

ahawks
Jul 12, 2004
Edit:
I've figured it out for now. Question was stupid.

ahawks fucked around with this message at 21:14 on Sep 10, 2007

cadmium
Feb 16, 2002

Just 'aving a laff...
I'm developing a simple (very simple) html form layout tool for a winforms app*.

Is there a decent library that makes it easy to drag little graphical widgets around and manipulate them a little (resize, right click menus, etc)? I just want the user to be able to drag controls around on the screen to place them where they want.

I thought about just making some winform controls draggable, but that seems pretty cheesy.




*I know there are a few free/cheap html designer controls, but everyone I've seen is just a wrapper for mshtml, which I think is A) overkill B) too much trouble to get the output I want, which is basically the x/y coordinates of each control. If there's something else free/cheap you know of, that would be great too.

jwnin
Aug 3, 2003
This is a .net non-technical question, but requires the help of .net developers. :)

We're developing an application that requires the following on the developer's workstations:

Web Service Software Factory (3)
Smart Client Software Factory (3)
Enterprise Library 3.1 (3)
Composite UI Application Block (3)
Guidance Automation Toolkit (2)
Guidance Automation Extensions (2)
Visual Studio 2005 Extensions for .NET 3.0 (1)

Our legal department is very, very keen on knowing if the software is:
1) only used internally in the development process
2)Automatically generates code for us (somewhat questionable, as studio itself will generate some code just for a blank project)
3) Results in shipping someone else's intellectual property (i.e. bundling their DLL with our system)[/list]

Can anyone with some experience in the tools above? I've asked our developers, and the responses haven't been ... great. I've included my guesses above.

Indido
Dec 8, 2004

"Now you know what I drive"
I'm working on an ASP.NET site and I'm having issues with the way ASP is resolving URLs.

The site is at http://company.com/Default.aspx (which works) but under SSL its:
https://hostingname.com/company.com/Default.aspx
This causes all my Response.Redirects to blow up, ASP forgets the company.com directory and goes to hostingname.com/Default.aspx.

Is there a way to change the way ResolveURL() works to force the company.com back in? Or maybe there is a config setting to tell it its actual application path?

csammis
Aug 26, 2003

Mental Institution

quote:

Visual Studio 2005 Extensions for .NET 3.0 (1)
...
1) only used internally in the development process
Yes, though of course the target environment will still need the .NET 3.0 Redistributable.

quote:

Enterprise Library 3.1 (3)
Composite UI Application Block (3)
...
3) Results in shipping someone else's intellectual property (i.e. bundling their DLL with our system)
If your developers use these components in their code, then yes, but that's pretty much the point of them. Have your legal department read the EULAs for the Enterprise Library, it's supposed to all be redistributables.

Frank Butcher
Oct 11, 2003

'Ave a word with yerself, darlin'
Is it possible to start and write C# code within a VB.NET windows form solution and have it work seamlessly with the existing VB code? I'm starting to move over to C# and have a large VB project that I'd like to gradually convert to a C# project. I've tried Google and is looks like it's possible with ASP.net.

Dromio
Oct 16, 2002
Sleeper

Frank Butcher posted:

Is it possible to start and write C# code within a VB.NET windows form solution and have it work seamlessly with the existing VB code? I'm starting to move over to C# and have a large VB project that I'd like to gradually convert to a C# project. I've tried Google and is looks like it's possible with ASP.net.

You may have both VB.NET and C# projects in the same solution (output to different assemblies). As far as I know, you cannot mix languages within a single assembly.

cadmium
Feb 16, 2002

Just 'aving a laff...
Did I stump the panel?

cadmium fucked around with this message at 18:06 on Sep 12, 2007

Shayla
Nov 4, 2004

Frank Butcher posted:

Is it possible to start and write C# code within a VB.NET windows form solution and have it work seamlessly with the existing VB code? I'm starting to move over to C# and have a large VB project that I'd like to gradually convert to a C# project. I've tried Google and is looks like it's possible with ASP.net.

I don't think that's possible, but you can use Roeder's Reflector for .NET, build your vb application, and disassemble it into c#. You'll lose your commenting, but the code should work.

These two together are awesome :3:

http://www.aisto.com/roeder/dotnet/

http://www.denisbauer.com/NETTools/FileDisassembler.aspx


I have a question too. I have 3 buttons bound like:
code:
cmdOK.DataBindings.Add("Enabled", dataGrid1, "VisibleRowCount");
When the form loads, the binds work. If there's nothing there, they're disabled. However, when the VisibleRowCount is first > 0 then 0, the properties don't change. Is there a way to call binding updates? Google isn't helping too much.

Shayla fucked around with this message at 16:46 on Sep 12, 2007

waffle iron
Jan 16, 2004

Dromio posted:

You may have both VB.NET and C# projects in the same solution (output to different assemblies). As far as I know, you cannot mix languages within a single assembly.
I thought it is possible to build an unlinked module and then compile it into an assembly with other source files.

Edit: I was right. Here is an example with Mono's compiler, but it uses the exact same arguments as Microsoft's C# compiler csc.

http://www.gotmono.com/docs/tools/mbascomp-cmdlo.html

waffle iron fucked around with this message at 16:51 on Sep 12, 2007

Dromio
Oct 16, 2002
Sleeper

waffle iron posted:

I thought it is possible to build an unlinked module and then compile it into an assembly with other source files.

Edit: I was right. Here is an example with Mono's compiler, but it uses the exact same arguments as Microsoft's C# compiler csc.

http://www.gotmono.com/docs/tools/mbascomp-cmdlo.html
Neat. I managed to add a VB code file to my project and it compiles without error. But now I can't figure out how to call that VB code from within my project:

code:
Namespace MyNameSpace
    Public Class Test
        Public Sub ShowHello()
            Console.WriteLine("Hello World!")
        End Sub
    End Class
End Namespace
But in my cs file (also part of the same namespace), the Test class is not available. Hrm.
code:
namespace MyNameSpace
{

    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            //There is no Test class?
            Test MyTester = new Test();
            MyTester.ShowHello();
        }
     }
}

Tomatoedipus
Aug 6, 2006
I don't want to cause no fuss but can I buy your magic bus?
I'm developing a WPF application to manage a collegiate debate tournament (Swiss style) as a personal development project. I need to persist: Schools, Debaters, Teams, Judges, Rooms, Rounds, and Matches. To clarify terms, the style dictates two teams in every match, each of which consists of two debaters. Every debater comes from a different school, although hybrid teams (teams that consist of debaters from two different schools) are allowed.

I'm wondering whether it would down the road be easier for me to keep all of this data in a series of custom objects with, say, a Tournament class that manages a series of collections, or as a separate SQL (compact) database.

I would like to be able to do some dynamic databinding to visual components (as debaters, teams, and schools will have to be manually entered for each tournament), and as an "it would be nice" feature, to allow multiple simultaneous data entry of tournament results within a college network. I would not like to require tournament directors to set up a separate server to host the database, as TD's are not likely to be very tech savvy.

Is this reasonably possible to achieve using SQL compact or should I just use objects and collections, or is there a third option that might better meet my needs?

I'm not sure what other information might be useful, so let me know if this question is unanswerable with this level of detail.

A688
Apr 15, 2001
A688 = Anut, because I like nuts

Tomatoedipus posted:

Debate tracker app thingy

What do you mean by a "separate" server? Since apparently you want to make this a WPF app, I'm assuming that you will have a few computers somewhere. You could easily use one of those as a database server. You don't need an extra computer just to host your database. As for which option, I go for option 3. Custom objects and databases are not mutually exclusive things. Use a database as persistent storage and use custom objects where you should in your program to help keep related data together. Also, is there some reason besides not "setting up a separate server" that you are picking on compact sql? That is designed for mobile apps and for instances when you need a database and you have very limited resources. What you probably really want is express edition. Installing it is pretty much as simple as clicking next a few times and entering a password for the admin account.

I wouldn't worry to much about using WPF for your interface until you get your back end thought out a bit more.

Fake edit: Too lazy to edit my above paragraph. When you say custom objects, do your really mean things like structures and classes or are you talking about something like xml files? XML would work for data storage but in my opinion using a real database would be easier.

Mmmkay
Jan 3, 2002

Hi guys, I'll start off by apologising for being a bit new to the .Net family. I'm currently writing hacking an existing program we have to extend its functionality. It is written in VB.NET for various reasons, and I am trying to talk to programs written in other languages with it.

If anyone's familiar with Access Grid, it's comprised of a Python front end application which uses two Tcl/Tk applications (VIC and RAT) for videoconferencing. I have no problems using SendMessage operations to talk with the Python app, but these methods have no effect on the Tcl/Tk applications.

Here's a snippet of what I'm doing (it's just a proof of concept at the mo and I've hard coded the window ID for testing. I would enumerate the child windows to find it normally):

code:
Private Declare Function FindWindow Lib "user32" Alias _
 "FindWindowA" (ByVal lpClassName As String, _ 
 ByVal lpWindowName As String) As IntPtr

Private Declare Function SetActiveWindow Lib "user32" _ 
 (ByVal hWnd As Integer) As Integer

Private Declare Function SendMessage Lib "user32" Alias _ 
 "SendMessageA" (ByVal hWnd As Integer, _ 
 ByVal wMsg As Integer, ByVal wParam As Integer, _ 
 ByVal lParam As Integer) As Integer
...
code:
Dim vcCheck as IntPtr
vcCheck = FindWindow("wxWindowClassNR", "Venue Client")
SetActiveWindow(vcCheck)
Call SendMessage(722580, BM_CLICK, 0, IntPtr.Zero)
This will happily toggle the "Enable/Disable" audio button for me on the Venue Client application. The exact same code with the hWnd of the Tcl button on RAT will not do anything though. I've used Winspector to check what's happening and RAT is definitely receiving the button press (I've tried lots of other methods, even going so far as mimicking the exact message event process when the button is clicked for real) but the application isn't doing anything.

Are there any methods for communicating with Tcl applications from VB.NET other than using user32? I'm a Java person normally and I've had all of about 3 days on learning VB far, sorry if this seems obvious.

I can do it the cheap way by moving the mouse cursor and creating a mouse click, but I really want to do it elegantly without having to bring windows to the front or take the mouse control away from a user.

Digital Disease
Jan 8, 2005

by Fragmaster
Is it possible to use variable names in the Table adapter configuration window to build the data source without extra crap? I've got other datasets that I've built during generation without a problem, but I'm trying to make life as easy as possible for report generation.

Here's what I'm after.
Example
code:
SELECT     EmployeeName, WeekEnding, TotalRegHr, TotalOTHr, JobTrackingID
FROM         EmployeeJobTracking
WHERE     (EmployeeName = 'this.employeeNameComboBox.Text') 
          AND (WeekEnding = 'endOfWeek.ToShortDateString()')
employeeNameComboBox and endOfWeek are the variables.

Hey!
Feb 27, 2001

MORE MONEY = BETTER THAN
http://forums.somethingawful.com/showthread.php?s=&action=showpost&postid=331764464

Does anyone have any ideas about this question? Basically, the idea is "chaining" Container, or Container.DataItem, or whatever, so that nested databound controls can inspect the DataItem that their parent is currently binding to. It's not a show-stopper but it's preventing me from doing neat UI things that I want to do. Thanks in advance for any ideas anyone has.

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

This should work:

code:
<asp:GridView runat="server" DataSource='<%# MyArray%>'>
    <asp:Repeater runat="server" DataSource='<%# DataBinder.Eval(Container.DataItem, "fieldname") %>'>
    </asp:Repeater>
</asp:GridView>

  • Locked thread