|
Anyone guys ?
Any ideas ?
|
|
|
|
|
Hello everyone
I have a second form in my program that will keep all the setting for my app
i am having a hard time to get my controls to pull the vavlue from the text boxes that is in the second form
What is the easyest best way to do this ??
or is thare a better way then using a second form
Thanks
Bobmodified on Wednesday, February 17, 2010 3:18 PM
|
|
|
|
|
In the second form do something like this:
public string SomeSetting
{
get { someTextBox.Text ; }
}
Then in Form1:
string mySetting = Form2.SomeSetting ;
Do this for all your text boxes.
|
|
|
|
|
is that for vb 2008 it dont work
|
|
|
|
|
Sorry, that is C#, I don't know VB.
But if you look up Properties, that should get you started.
|
|
|
|
|
Thats cool thanks anyways
|
|
|
|
|
Public ReadOnly Property SomeSetting() As String
Get
Return SomeTextBox.Text
End Get
End Property
Dim mySetting as String = Form2.SomeSetting I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hello Everyone,
I am looking into developing an extension for windows explorer that will add a kind of a virtual folder (which access files and directories through a web service) so that I can drag files from my desktop and deposit them on a server via a web service.
Any ideas on how I should proceed? I'd like to write this in either c# or vb.net.
Thanks!
|
|
|
|
|
seanwright wrote: I'd like to write this in either c# or vb.net.
Either will do
seanwright wrote: Any ideas on how I should proceed?
Buy a book for the language you have decided on, start with the easy examples and work up from there.Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks for the tip. However, I have been writing programs for several years, albeit rather simple ones. I am familiar with both languages.
I guess I should be more precise: what I really want to know is: what are the mechanisms involved with creating this type of application? How do I interface with windows explorer through .net? Can anyone direct me to some sample applications?
Thanks
|
|
|
|
|
Writing shell extensions in anything other than .NET 4.0 is highly recommended AGAINST.
If your entire experience is writing simple applications, a shell extension is going to be a major shock to you. Unless you have a very good working knowledge of COM and how to interop, you'll find this task very tough. For a sample of what you'd be getting into, read this[^].
seanwright wrote: so that I can drag files from my desktop and deposit them on a server via a web service.
A stand-alone application would allow you do this much easier than writing a shell extension, and you can write this in any lanugage you want.
|
|
|
|
|
Hi,
I use OdbcCommandBuilder.DeriveParameters to get a stored procedure parameters and fill them in with values. After that, I can access the command object to see all parameter's name and values. But when I fill the command with the data adapter I got the following error:
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'sSPName' expects parameter '@dteBeg', which was not supplied.
Code:
......
Dim cmdODBC As OdbcCommand = cnnODBC.CreateCommand()
cmdODBC.CommandTimeout = 300
cmdODBC.CommandType = CommandType.StoredProcedure
cmdODBC.CommandText = sSPName
cnnODBC.Open()
OdbcCommandBuilder.DeriveParameters(cmdODBC)
'Add values to parameters:
For i As Integer = 0 To cmdODBC.Parameters.Count - 1
......
Next
'Write out the parameter's name and value:
For Each parameter As OdbcParameter In cmdODBC.Parameters
response.write(parameter.ParameterName & "=" & parameter.Value)
Next
Dim adpODBC As New OdbcDataAdapter(cmdODBC)
adpODBC.Fill(ds, "Results") 'error appeal here.
......
Any helps are appreciated.
|
|
|
|
|
Hi,
I have a webapp on my filesystem that will eventually be deployed somewhere else where IIS obviously exists.
For now is it possible for my webapp to be made accessible from other systems on the LAN without hosting it on IIS? I mean can it be accessed from the development server itself? Something like:
http://10.x.x.x:port_number/MyWebAppName
I mean if I unblock the port in my firewall.
Kindly advise. I just need to get it up and running for a demo.
|
|
|
|
|
No, you must have a webserver of some kind. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
callousfantom wrote: from the development server itself
Cassini[^]?I are Troll
|
|
|
|
|
Hi,
As already pointed out, I was asking if it could be accessed from the development server itself. If not, can anyone guide me as to how to host it on IIS 7(windows vista). I have never hosted a website and am absolutely clueless.
My website is built in Visual Studio 2008. I Installed IIS 7. Added my website folder to inetpub/wwwroot, converted it to Application inside the "Default website" as I read in an article and even created an Application Pool and assigned it to my website but it keeps throwing different sorts of errors.PLEASE HELP. ITS URGENT! modified on Thursday, February 18, 2010 12:20 AM
|
|
|
|
|
I write to inquire if there is a way to develop java code using VSTS 2008? Is there a snapin or compatible app that would allow this? Much thanks for an informed opinion.
|
|
|
|
|
You can use VS to write the code but would not have any intellisense or other support, just as would get with notepad. You would also need a suitable compiler. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
To add to Mark's comments, I have done this for a small project, but without the intellisense and keyword highlighting it is not a great experience. I would much rather use Eclipse or NetBeans as both are geared to Java development, whereas Visual Studio is not. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi everyone,
I'm so confused right now I'm hardly sure where to begin. I've been tasked with writing an application using MSMQ. Basically, the app listens to a file folder, notices when a file's been added, sends a message to a router queue which then figures out what to do and sends a message to the appropriate processing queue. The router queue is receiving messages and it seems to be sending them on to the processing queue but the processing queue never receives the message. I've tried everything I can think of to get this working but cannot seem to do so and have no clue why not. No matter what I try, the processing queue never seems to receive the message that was sent to it.
Here's how the main program creates the router object (this is the one that works):
Private Sub StartRouter(ByVal myNode As XmlNode)
Try
m_RouterQueueName = myNode.Attributes("queuename").Value
TheRouter = New Router(m_RouterQueueName)
AddHandler TheRouter.onRouterStarted, AddressOf LogActivity
AddHandler TheRouter.onRouterMessageReceived, AddressOf LogActivity
AddHandler TheRouter.onRouterError, AddressOf LogError
Catch ex As Exception
LogError(ex)
End Try
End Sub
And here's the constructor in the router object:
Public Sub New(ByVal QueueName As String)
Try
m_QueueName = QueueName
StartListening()
Catch ex As Exception
RaiseEvent onRouterError(ex)
End Try
End Sub
You'll notice that it has a "start listening" routine. Here is that routine:
Private Sub StartListening()
myReceiveQueue = New MessageQueue(m_QueueName, QueueAccessMode.SendAndReceive, False, QueueAccessMode.SendAndReceive)
Try
'myReceiveQueue = New MessageQueue()
'myReceiveQueue.Path = m_QueueName
myReceiveQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(System.String)})
myReceiveQueue.UseJournalQueue = True
RaiseEvent onRouterStarted("Router listening to " & m_QueueName, "Started")
AddHandler myReceiveQueue.ReceiveCompleted, AddressOf MSMQ_ReceiveCompleted
myResult = myReceiveQueue.BeginReceive()
Catch ex As Exception
RaiseEvent onRouterError(ex)
End Try
End Sub
Now as to the processor (this is the part that's not working), here's how the calling program creates it:
Private Sub SpawnProcessors(ByVal myNode As XmlNode)
Try
For Each childnode As XmlNode In myNode
Dim myNewProcessor As New Processor(childnode)
AddHandler myNewProcessor.onProcessorStarted, AddressOf LogActivity
AddHandler myNewProcessor.onProcessorError, AddressOf LogError
AddHandler myNewProcessor.onProcessorMessageReceived, AddressOf LogActivity
ProcessorCollection.Add(myNewProcessor)
Next
' once we've been through all the processors and started them all, introduce this list to the router
TheRouter.IntroduceProceduresToRouter(ProcessorCollection)
Catch ex As Exception
LogError(ex)
End Try
End Sub
Since the router sends messages to the processors you'll see that I have a line in there that introduces the processes to the router. All this does is take the collection of processors and "copy" it to the router so the router can know what's going on (maybe the problem is in doing this???):
Public Sub IntroduceProceduresToRouter(ByVal myList As List(Of Processor))
m_KnownProcesses = myList
End Sub
The constructor for the processor object is like this:
Public Sub New(ByVal myNode As XmlNode)
Try
Config = myNode
m_QueueName = myNode.Attributes("queuename").Value
m_Type = myNode.Attributes("processtype").Value
StartListening()
Catch ex As Exception
RaiseEvent onProcessorError(ex)
End Try
End Sub
It also has a "start listening" subroutine associated which looks like this:
Private Sub StartListening()
Try
myProcQueue = New MessageQueue(m_QueueName, False, False, QueueAccessMode.SendAndReceive)
myProcQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(System.String)})
myProcQueue.UseJournalQueue = True
RaiseEvent onProcessorStarted("Processor listening to " & m_QueueName, "Started")
AddHandler myProcQueue.ReceiveCompleted, AddressOf MSMQ_ReceiveCompleted
myResult = myProcQueue.BeginReceive()
Catch ex As Exception
RaiseEvent onProcessorError(ex)
End Try
End Sub
Now when the router receives a message, it reads it from the queue like this:
Private Sub MSMQ_ReceiveCompleted(ByVal p_source As Object, ByVal p_objAsyncResult As ReceiveCompletedEventArgs)
Try
Dim myMessage As Message
myMessage = myReceiveQueue.EndReceive(p_objAsyncResult.AsyncResult)
RaiseEvent onRouterMessageReceived("Router", "New message Received in Router Queue" & Chr(13) & myMessage.ToString)
RouteMessage(myMessage)
myResult = myReceiveQueue.BeginReceive()
Catch ex As Exception
RaiseEvent onRouterError(ex)
End Try
End Sub
And it uses the RouteMessage function to send a call to the proper processor (right now there's just the one and until I can get it to accept messages there's no use to add any more). But here's the RouteMessage sub:
Private Sub RouteMessage(ByVal msgToProcess As Message)
Try
' get the XML from the body of the message
Dim xmlDoc As New Xml.XmlDocument
xmldoc.LoadXml(msgToProcess.Body)
Dim myNode As XmlNode
myNode = xmlDoc.SelectSingleNode("descendant::process")
' read the first child to determine what the next process is
Dim NextAction As String
NextAction = myNode.ChildNodes(0).Attributes("type").Value
For Each SingleProcess As Processor In m_KnownProcesses
If NextAction = SingleProcess.Config.Attributes("processtype").Value Then
'Dim myQueue As New MessageQueue(SingleProcess.myProcQueue.Path)
' myQueue.Send(myNode.OuterXml)
SingleProcess.myProcQueue.Send("Test Message")
'myQueue.Send("Test Message")
'myQueue = Nothing
'SingleProcess.myProcQueue.Send(myNode.OuterXml)
Exit For
End If
Next
Catch ex As Exception
RaiseEvent onRouterError(ex)
End Try
End Sub
As you can see in my for loop I've tried several different things. But nothing's working. I'm not even getting the processor to recognize the simple text message that I sent. No errors are being thrown that I can see... it's just not doing anything. I put a breakpoint on the processor's MSMQ_ReceiveCompleted subroutine and it never ever gets hit.
I saw an article somewhere in my research today that helped me find where the MSMQ queuing properties control panel is and it says that the message files folder, message logging folder and transaction logging folder is all the same one -- C:\Windows\System32\msmq\storage. I looked in there and opened what I found in notepad but can't read any of it.
How can I tell if the processor queue is even receiving the message at all? I'm so lost.
I hope someone can please help me understand what I'm doing wrong. I'd greatly, greatly appreciate it.Denise "Hypermommy" Duggan
|
|
|
|
|
I want to print crystal Report(10.5).
Default Printer:"Microsoft XPS Document Writer".
I want multiple pages to print.
If a report contain 10 pages then each page should be repeated as per requrement.
The code is in vb.net.
gReportDoc.PrintToPrinter(2, True, 0, 0)
The above statement should print double the copies in browser,but i get single copy of each page.
Also instead of direct printing,if i done preview.10 copies r get displayed.Its fine.
But there is printing tool above in crystal viwer.In that dialogbox if i give there: No of copies=2,then also unable to get multiple copies in browser.
is there any printer setting problem..?
But my vb vode is working fine,ie multple pages get printed in browser. In which I have set CR.CopiesToPrinter=2.
|
|
|
|
|
Hello,
this is a long story. I will try to make it as short as possible, so please bear with me.
A while ago a friend and I started out to write something what you might call a browser game. The first version used ASP.net web pages and a nice three tier architecture. Along the way we felt that a game which more or less looks like a collection of forms is not really exciting. So we did away with the web pages and replaced them with a webservice and a windows forms client.
This was a bit better and also offered the advantage of buffering data on the client and doing some GDI+ based rendering. But there was still room for improvement. So why not host XNA in windows forms? This was not easy to do since WinForms are event oriented while an XNA apllication runs in an endless loop to render as many frames as possible.
In the end I came up with a WinForms control that featured the functionality of XNA's Game class. Under the hood a WinForms control still uses a Win32 window which XNA (or better: DirectX) needs as a rendering target. Also, I used the Application.Idle event to trigger the rendering of a new frame.
Well, WinForms still are a bit limited on the design side, so why not move on to WPF? So we went just ahead and based the client on WPF. The only problem is hosting XNA in WPF.
For starters we put our WinForms XNA host control in a WPF WinFormsHost and... nothing happened.
It turned out that the Application.Idle event never fires in a WPF application and so no rendering was ever done. So this is my first question here: Does anybody know an event or other means to replace this? I have a crude workaround by putting a timer with a short timeout period on the XNA host control which triggers the rendering. It works fairly well, but the rendering is not as smooth as it used to be.
Indeed, I would like to do away with the WinForms control entirely and replace it with a WPF control. The problem there is that DirectX needs a Win32 Window as rendering target. Do WPF controls still have Win32 windows under the hood or does anybody see another way to provide this in a WPF control?
You see, the whole thing goes over a few tables and benches, so I posted it here in the forum for the .Net framework. I hope you don't mind. And thanks in advance for the replies.
PS: The whole project, of course, is 'homework'. In the sense of doing this as a hobby at home. My bosses at work only want me to write boring business apps
|
|
|
|
|
|
Yes, tricky is the right word. A GUI and a typical DirectX (or XNA) application do not have too much in common. The GUI application tries to use the CPU sparingly by handling events and idling most of the time. A DirectX application tries to get all the CPU time it can and make the best of it.
My approach to bringing XNA and WPF together resembles the second one you mentioned. The main difference is, that my control tries to replace XNA's game class and does not try to tweak it into accepting the control as render target.
The game originally was supposed to be a web application and still retains the behavior of a website because the client connects to the server over a webservice. This way it will certainly not be a hot action game. Most of the time there will still be some kind of forms and while we want a good design, we also value such things as data binding or our MVP libraries to keep the code short and orderly. A DirectX application will make those things more awkward and NeoForce still misses some controls we would certainly need.
The game is going to be something like the good old Master of Orion. The players will be exploring unknown planets and build colonies, research new technology. There will be trade, espionage, politcs and some strategic and tactical combat. But at no point will the player be shooting himself. Instead he will mashall his fleets, troops and commanders. In the end we need a GUI more than DirectX.
Let's say the player is looking at his colony. On a website we could display a grid with all buildings he has. Efficient, but not very appealing. Puzzling together some kind of image would be possible, but a little awkward. Rendering a dynamic image would be a little hard on the server and Microsoft does not recommend it because GDI+ is officially not safe to use in a web application.
Sending the information of the player's colony to a client is a more logical choice. We can then leave the work of visualizing the colony and its buildings to the client and also eliminate the need to send a large bitmap at every page request. Under WinForms we have to deal with some ugly flickering and sometimes a hard time when trying to get rid of the typical WinForms look, but GDI+ at least can efficiently compose a custom image. A static image may not be state of the art, but at least it is a custom image generated in no noticable time.
WPF was mage to allow rich means of designing and animating your GUI and there is no ugly updating and flickering, making the whole thing look much less old fashioned. We could also easily visualize things with custom images. So far, so good. But with XNA we can put together a scene of the planet's landscape and the player's buildings plus some little animations like drifting clouds or a landing ship.
The same goes for visualizing the star systems. The player will have quite a few controls to navigate and get information about the objects he sees. Again we could simply display a grid with all the boring facts. Or we could put together an image and let the player scroll through the system. With WPF we could also render and animate some spheres and put some textures on them. XNA will add full support of shaders and multi texturing and make the whole thing look far more interesting.
And, even more important, we are a bit tired of tearing everything apart and putting it back together in yet another way. We finally want to get down to business
|
|
|
|
|
Hello,
I have a full application suite of software (multiple dlls) that is launched from a single exe acting as a main menu. The applications within this suite can be launched from the main menu or from IE that tells the exe to launch a specific application. I want to change the way that IE is currently launching the apps (current method is embed a dll in an html page) to using create object. So have a com wrapped dll that will tell the exe to launch a specific app using mutex. This dll not only tells the exe to launch an app, it also will start the exe if it's not running already. My problem is when it has to start the exe, I'm not sure when the exe is fully loaded to start excepting launch requests(they go unheard or cause errors). I have tried to use flags that in my mutex i'm checking but with the complexity of mutex it's giving me false positives that the exe is ready. I'm tried loops but that results in a not responding of IE or the exe itself - the not responding goes away but I can't have that coming up each time it starts.
The main purpose for using mutex is to control multiple instances of the exe starting. If it's started via IE, it becomes a tray icon with the mainmenu being hidden only accepting launch requests from the browser. If the user then double-clicks on the desktop short cut, the 2nd instances tells the 1st instance to launch the main menu then it will accepting launch requests from both the mainmenu and the browser. So i'm trying to use the 2nd instance to tell the 1st instance to launch an application when the com wrapped dlls does a loadassemblyfrom but the 1st instance isn't fully loaded yet whenn the 2nd instance tries to tell it to launch an app.
Does anyone have any ideas on how to "poll" the exe to make sure its ready before I tell it to launch an app so that I don't run into these not responding messages? I've used setTimeout javascript code to poll but that either doesn't work or also causes the not responding.
thanks for your time
Nathan'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|