Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Rick Crone

@Rick Crone
About
Posts
45
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Compiler Error Numbers
    R Rick Crone

    Right click the error message and Show Error Help. At the top of the help window you will see a message like: Visual C# Reference: Errors and Warnings Compiler Error CS1501

    C# visual-studio help question

  • Console App
    R Rick Crone

    Maybe you want to create a windows application and handel the click event... and just place the source code from your console application into that event handler.

    C# question

  • serial port sniffer ( spy or monitor)
    R Rick Crone

    Why do they have to be on the same PC? If they really don't then make a cable that taps wires TX, RD and Ground (on a 25 pin I think that's 2 3 and 7). Hook the taped lines to the com port on the other machine and you can monitor the traffic.

    Managed C++/CLI c++ help tutorial

  • port on/off checking after my program is slow
    R Rick Crone

    Have you tried setting these timeouts to smaller numbers. CommTimeOuts.ReadIntervalTimeout = 0xFFFFFFFF; CommTimeOuts.ReadTotalTimeoutMultiplier = 0; CommTimeOuts.ReadTotalTimeoutConstant = 0; CommTimeOuts.WriteTotalTimeoutMultiplier = 0; CommTimeOuts.WriteTotalTimeoutConstant = 5000;

    C / C++ / MFC c++ com question

  • Shared Folder Access
    R Rick Crone

    You could use the NET USE comand line utillity to assign a drive letter to the folder then access it just like you would a local drive. C:\Documents and Settings\rick>net use New connections will be remembered. Status Local Remote Network ----------------------------------------------------------------------------- OK J: \\MCL002\PCACE Microsoft Windows Network OK L: \\MCL001\LIS Microsoft Windows Network OK M: \\MCL002NT\NTDATA Microsoft Windows Network OK N: \\MCL001\LISDATA Microsoft Windows Network OK S: \\MCL001\SHARED Microsoft Windows Network OK W: \\MCL001\PROGRAMMING Microsoft Windows Network The command completed successfully.

    C / C++ / MFC tutorial

  • Build times
    R Rick Crone

    I added a post build step to do this: date /t time /t

    C / C++ / MFC csharp visual-studio question

  • __LINE__
    R Rick Crone

    Oh... ok I am using debug builds... but I have not copied PDB file to the production machine. When I tested Environment.StackTrace I was on my development machine. I bet I won't get line numbers from that either on the production machine. Thanks again!

    C# csharp c++ question

  • __LINE__
    R Rick Crone

    Thank you for your reply! I'm currently working on some services and I'm not seeing the line number when I catch an exception. Maybe it's because I handled the exception - by exiting my service but this is an example of what my exception reports: System.Data.SqlClient.SqlException: SHUTDOWN is in progress. Log off. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at GetAcc.GetAcc.timer1_Elapsed(Object sender, ElapsedEventArgs e) I want the line number so I know where (which exception trap) trapped the error. In a case like the example above (depending on what step I'm in in my process) I may be able to keep my service alive until the SQL server is available again. I have found that I can use Environment.StackTrace which gives more info... but does include the line number. So I'm adding that to my message that I log to a file.

    C# csharp c++ question

  • __LINE__
    R Rick Crone

    I found this: CodeLinePragma clp = new CodeLinePragma("Service1.cp",188); but it doesn't seem to keep up with the line number... it just reports back whatever I initialize it with.

    C# csharp c++ question

  • __LINE__
    R Rick Crone

    In C++ we have a macro __LINE__ that can be used to report what line of source code we are on. Is there a way to do this in C#?

    C# csharp c++ question

  • VC++ Standard ED final .exe program?
    R Rick Crone

    Does the ED mean educational version? In the full version there are Debug and Release directories under the directory your source code is in and that's where the EXEs are found. I really don't know if the educational version builds an EXE or not... and don't that this the wrong way, but you could use the Windows SEARCH to try to find the .EXE file.

    C / C++ / MFC c++ announcement tutorial question

  • C++ vs. C#
    R Rick Crone

    I have been creating VC++ solutions for years. I started looking at C# about a year ago. I have just recently implement a fairly complex solution using 5 Windows services and a Windows application to monitor the services using C#. It's LIVE in our production environment and seem quite robust. This is the first 'real' working C# code for me. I wrote the code in about two months. Most of that time was devoted to issue to solve the 'problem'... not a lot to just getting services to work. To me that's a pretty powerful language. Here are a few of things I have found about C#. If you want to write a Windows service I would recomend it over C++. The help system includes a great Walkthrough for creating a Windows service. Implementing timers is very easy. Access to the Windows event logs is very easy. While I am still experimenting with .NET ASP you can use C# as code behind for those pages allowing you to deal with events on a web page with events in a Windows application. So there are something that are easier in C# and some new things like code behind for ASP web pages that I don't think you can do in C++. Others might point out other features... but if you are interested in these areas you really should look at C#.

    C / C++ / MFC csharp c++ visual-studio com graphics

  • When is your deathday?
    R Rick Crone

    A Windows crash???

    The Lounge c++ question

  • Website can't access SQL2k DB
    R Rick Crone

    How?

    Database database help sql-server sysadmin security

  • DataGrid
    R Rick Crone

    Thanks you for your reply. In my application I'm trying to display records in a table that let me know that some services I have written are working. At this point I'm updating the display on a button click. I tried to apply the code I found in the example you pointed me to. You can see the error message from my exception trap. Can you tell me where I when wrong? private void m_btnUpdate_Click(object sender, System.EventArgs e) { this.sqlDataAdapter1.Fill(this.imAliveDataSet1,0,0,"ImAlive"); // Gets the DataGridTextBoxColumn from the DataGrid control. DataGridTextBoxColumn myTextBoxColumn; myTextBoxColumn = null; // Assumes the Time column is a DataGridTextBoxColumn. try { myTextBoxColumn = (DataGridTextBoxColumn)dataGrid1. TableStyles["ImAlive"].GridColumnStyles["Time"]; } catch (Exception excpt) { string strMsg = string.Format("{0} Exception caught.", excpt); } // Gets the DataGridTextBox for the column. DataGridTextBox myGridTextBox; myGridTextBox = (DataGridTextBox) myTextBoxColumn.TextBox; strMsg "System.NullReferenceException: Object reference not set to an instance of an object. at FordMon.Form1.m_btnUpdate_Click(Object sender, EventArgs e) in c:\source\ford\fordmon\fordmon\form1.cs:line 227 Exception caught." string

    C# question

  • DataGrid
    R Rick Crone

    I have a DataGrid in my windows app. One of the fields is a date time type. It's showing up at a date in my DataGrid. I really need to see the time too. How can I change the format of this one field in the DataGrid?

    C# question

  • How can I manage to execute an application in a administrator mode
    R Rick Crone

    The command line parameters can be used in the InitInstance() of your application. The command line is stored in m_lpCmdLine which is a char array. If you pass your parameter with a slash (ie. /MYPARM) they will be considered flags. If you don't include the slash the first parameter will be considered to be the file you want to open. You can turn off that behavior my setting: cmdIndo.mShellCommand = CCommandLineInfo::FileNew; but why not just include the slash? *NOTE you can test your command line parameter in the developer studio! see the PROJECT - SETTINGS - DEBUG(tab)

    C / C++ / MFC tutorial question

  • .NET wont add classes to my dialogs!?
    R Rick Crone

    I haven't seen this problem in VC++ 7.0... but there is a utility to downgrade your VC++ 7.0 project to VC++ 6.0 on CodeGuru. Sounds like you might be ready to abandon 7.0... I have.

    C / C++ / MFC help csharp c++ html debugging

  • Refresh problem with CRecordset
    R Rick Crone

    This may depend on the version of the OS and/or the version of the ODBC driver... but check to see if you can set the buffer size. I think I ran into something like when moving one of my application to ME and I may have been moving to a newer ODBC driver at the same time (sorry I don't have details on version number just now). Anyway I think there was something that set the buffer to 1024 and I changed it to 256 (or something like that).

    C / C++ / MFC database help tutorial question

  • Settings in Visual Studio.NET
    R Rick Crone

    This maybe lame help... but I think you may want a 'custom application wizard'... or something like that. I have not done this yet... but I really should.

    C / C++ / MFC csharp visual-studio help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups