cVic's Q&A profile
Visual C++ Detecting compile in Studio 2005 vs. Studio 2003 or 6.0
I share common source code with several other projects that compile in Studio 2003, Studio 6.0, Borland, or (gasp) an embedded Green Hills compiler. Is there a #define I can look for so that I can fix all the deprecated CRT functions when I use the code in Studio 2005 (and so I can leave the old unchanged version in place for all the other folks) Something like #ifdef STUDIO_2005 strcpy_s(DestString, sizeof(DestString), SourceString); errno_t err = fopen_s(&fp, Filename, "r"); #else // for older compilers strcpy_s(DestString, sizeof(DestString), SourceString); &n ...Show All
Software Development for Windows Vista SetConsoleCtrlHandler() in Vista
Hi, I have a win32 console tool compiled in VC2003 that I'm running on Vista 5356. The app calls SetConsoleCtrlHandler() and the handling function watches for CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT to trigger in order to write out some state information when a reboot occurs. This method worked fine in XPSP2 and Vista 5308. Now, in 5356, the handler never even gets triggered on a reboot. Neither CreateEvent() or SetConsoleCtrlHandler() return any errors. Also, the tool wont even run unless i launch it from a command prompt that was itself launched using right click->Run as Administrator. This was expected, however. Any h ...Show All
Software Development for Windows Vista Need help using CompositeActivityDesigner
I have a custom CompositeActivity with a custom CompositeActivityDesigner. I'm placing this activity inside a custom root activity, that uses a FreeFormActivityDesigner. The trouble is that the activity designer won't allow drag and drop another activity into it. I overrode CanInsertActivities and can say that it is not being called. (Also, CanInsertActivities is not called on the FreeFormActivityDesigner, either, but it does allow dropping an activity into it - any activity...) I must be missing something, does anyone have an idea what it might be I figured it out a solution, posting it for o ...Show All
Smart Device Development CCommandbar with cmenu
I try to insert a menu to ccommandbar, then delete a submenu in it. Is there any example on ccommandbar with cmenu m_cmdbar = new CCommandBar(); m_cmdbar->Create( this ); m_cmdbar->InsertMenuBar(IDR_MENU1); HMENU hMenu = m_cmdbar->GetMenu(); CMenu* pMenu = CMenu::FromHandle(hMenu); CMenu* submenu = pMenu->GetSubMenu(0); BOOL i = submenu->DeleteMenu(ID_OPTION_NEW, MF_BYCOMMAND); m_cmdbar->DrawMenuBar(IDR_MENU1); my above code does not hide the "new" menu, although I got the boolean i return as TRUE. So I suspect the problem is on the last line, which I don't know what to put in the ...Show All
Windows Forms Wanted: Textbox listing links (ala the Outlook "To" field)
Are there available incarnations of a textbox control which contain a list of links. As reference, I am looking for something that behaves like the "To" or "BCC" mail address fields on a new message in Outlook mail. Anyone know of any examples out there. Or if it is easy enough to create a make shift new control. ...Show All
Visual Studio Express Editions Evaluate Code Stored in String
How can I evaluate / execute code that I have stored in a string I have many textboxes named: tb1, tb2, tb3, etc. I want to run code like this: For i = 1 to 3 temp1 = "Me.tb" & i & ".Value" temp2 = [EVALUATE or EXECUTE](temp1) Next Any suggestions / helps Please also let me know which libraries need to be included. Any help is appreciated. Thank you! Take a look at the MSScript control. I would like to see exactly what you are trying to do. MSScript is quite powerful but it takes some learning. Its not hard, just takes a little practice. You need to make an interface of wh ...Show All
.NET Development TableRow Array object reference not set to an instance of an object
I have a TableRow array that Im trying to store rows I add to a table later, But when I try to add Cells to each row on the first " trows [ i ] . Cells.Add(tcell); " line I get error stating 'Object reference not set to an instance of an object'. Based on the code I had before where I just had a single table row that is initialized new each time in the loop I think that might be why Im getting the error. But how can I get this to work so I can have an array of rows that I add to a table in a differnt part of the code TableRow [] trows; while (rdr.Read()) { for ( int i = 0; i <= 29; i++) { ...Show All
.NET Development Invalid character value for cast specification.
Hi all, I am runing SQL Server 2000, Windows 2003, and doing this in C# on .Net Framework 2.0. I have the SQL Statement: insert into test_table (col_1) values ( ) OleDbParameter Value = 65788 OleDb Data Type is OleDbType .Numeric col_1 has a data type of Numeric(18,0) But I keep getting this error message: Invalid character value for cast specification. The same procedure works for all column type available on SQL Server 2000, and I have created a test table that contains every available column on SQL Server 2000, and all works except OleDbType .Numeric and OleDbType .Decimal. I have also tested the sa ...Show All
Visual C++ how do I install missing file msvcr80.dll
Please, if someone knows how to install file msvcr80.dll, if you don't mind let me know. Check this: http://www.dll-files.com/dllindex/dll-files.shtml msvcr80 ...Show All
Windows Forms Saving a picture
I have a picture box that i can draw in using mousePath.AddLine This works well but now i need to save the image into a datadase. Can anyone let me know how to do this And what datatype in the database table should I use What about to save a document in the same table Great example, thanks. ...Show All
Visual C# Threaded Controls
I'm a little confused on how to show a progressBar with style continious on a seperate thread. Do I need to create the progressBar at runtime...or can I pop one on the form and just invoke it Style Continious can just be set in properties...with nothing really to do in the threadproc...know what I mean My form is also getting very "crowded"....mucho hidden panels groupbox, etc. Rather create at runtime and just bringtofront....let it run...and then abort when finished. TIA You can add the control dynamically, at runtime. See "To add a control to a form programmatically" in this doc . You'll still need ...Show All
SQL Server Unable to use MS SQL 2000 SA Password
Dear All! I have installed my sa password "sa" during my MSDE (desktop engine of sql) installation. currently i am loging into query analyzer using windows authentication. But i cant access the database through my code, coz i dont have sa access. Please kindly Help me finding my current sa password. Thank You! Did you get an answer I am having the same problem. Thanks. Oguchi ...Show All
Windows Forms How to call another sub
I have a sub which handles a button click eg. Private Sub btnSearch_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click ' method End Sub I want to call this sub from another one so I used Call btnSearch_Click But this throws an error becuase I didnt pass the sender and e parameters, so really need to know how to pass these arguments Thanks Ben Call btn_Search( Nothing, EventArgs.Empty ) a better solution would be this: Private Sub CallMe() MessageBox.Show( "Called" ) End Sub Private Sub btn_Search( Sender As Object... ) &nb ...Show All
Visual C++ Function pointers and delegates
I'm trying to build a managed wrapper in C++/CLI for an existing static library written in C. I have a class where a few callbacks are needed. In the static library you have a function called "set" which registers the callback. However I'm strugling with some managed vs. unmanaged type problems. Lets say you have a callback with the following prototype: void f1proc(char *szString, int nSomeOtherData); Since I want to use String ^ instead of char * in the managed class I think I need to do the following: 1. Create a function with above prototype in my wrapper class. 2. Expose another function (as a delegate) which has similar prototype but us ...Show All
Visual Basic Progress bar
Hey, I have 14 textboxes and a progress bar , and i want it to go up 7% everytime one of the textboxes is filled in. So i have this: Hi, Have you tried changing + and = like this: If text2 > "" Then ProgressBar1.Value += 7 :) Max ...Show All
