Answer Questions
limethief serialPort.Read
I have been playing around with the serial port class for about a week and have managed to learn a small number of different ways to read the data in and then act upon it. I have just successfully written code to use the serialPort ->ReadByte() method. My problem with this method is that no matter how large (number of bytes) the data is, it will only read one byte at a time when data is received. I want to read a small data packet which contains three characters. I have attempted to use the serialPort->Read() method, but I keep getting a null error. My code is: private : System::Void serialPort1_DataReceived(System::Object^ sender, System::IO::Ports::SerialDataReceivedEventArgs^ e) { int offset = 0; int count ...Show All
Grace SQL VC++ 2005 memory management functions
I posted the below on microsoft.public.vc.language with no reply. I'd appreciate any feedback - the documentation is sparse on these issues. -------------- We're about to make a major release. Recently I have been testing the use of the low fragmentation heap that comes with Visual C++ 2005. We ship libraries and in our release notes we would like to offer some tips on how to developers integrating our components on how to get the best performance. Previously we recommended _set_sbh_threshold(1016) to improve performance. Running our tests with the low fragmentation heap enabled results in speed-ups in 99% of our tests. However a few of the tests demonstrate severe speed degradation. In these we allocate of the order of 100,000 sm ...Show All
sureshv Problems Using TextOut in win32 app
Hey all :) I've recently moved to VS 2005 and it gives me hard times with my win 32 applications which I have written in older VS versions (2003). I have trouble with TextOut function: TextOut(m_memHDC,x,m_winH-y, "Hello" ,strlen("Hellow")); I get this error: error C2664: 'TextOutW' : cannot convert parameter 4 from 'const char [7]' to 'LPCWSTR' And why does it automaticly uses TextOutW and not TextOut, Is there a way to convert null terminating strings ( char*) to this LPCWSTR Thanks In Advance Apart from the name, and the header in which it is declared, TEXT() and _T() are exactly the same. Cool thanks! I should have read your ENTIRE post ...Show All
ahmed921983 Need help! Not able to get UdpClient BeginReceive work in VC++/Could this be a complier bug!?
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient ... First of all, thanks for microsoft team for this post. However I have couple questions concerning the C++ code in the link. Before posting my questions, first let me show you how I did set up a VS2005 C++ project to test this code. To create a test project, I do following File->New->Project->(Other Languages)->Visaul C++->CLR->Class Library Fill in solution name and put in the following code. ----------------------------------------------- TestAsynCallback.h ----- ...Show All
Info_Peter Creating Owner Draw ListBox using Create function
I have created an owner drawn list box as follows DWORD dwFlags = WS_CHILD|LBS_OWNERDRAWFIXED|WS_BORDER|WS_POPUP|LBS_NOTIFY|LBS_NOINTEGRALHEIGHT; m_ListBox.CreateEx( 0, WC_LISTBOX, _T("ListBox"), dwFlags, CRect(10,10,250,250),this, 0 ); But the DrawItem call is not happening to the listbox. Any clues Maybe you do not provide the important MeasureItem handler for your control, or the control does not contain items, or the control actually should be created with Create function Hi, I do not see anything immediatly clear to me with the way you create a list box. It is not quite clear what exactly is the issue from amount of information in this post. Please try building a complete ...Show All
Dominik Chrzanowski Outlining is confused
I have had cases where outlining seems to be confused with just where I am in the source code. That is, if I right-click to get the context menu and choose the outlining flyout, the flyout will show me: Collapse block: if( xxx ) but I am not in the if( xxx ) statement. In fact, I have had cases where I am not even in the function that contains an "if( xxx )" statement! I have gone ahead and selected the collapse block command just to see what happened. It did not collapse the block I was in (I had such a block in another function in the same source file but it did not collapse either). Strangely enough, as I started scrolling through the code of the function I was in, I did see that all of the comments were collapsed. Howev ...Show All
Pankaj11 VC++ 2005 Win32 redistributable
I would like to make a single file, redistributable "Hello World" program. Is there a way of compiling any depenent files/DLLs into the helloWorld.exe program #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { printf("Hello World!!!\n"); return 0; } OR #include "stdafx.h" #include "iostream" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout << "Hello Object World!!!\n"; return 0; } *** please test (must run on a computer other than the one used to compile) TaylorClark wrote: If so, change it to /MTd for your debug configuration and /MT for your release configuration. What this is do ...Show All
ASP Developer How to overload the ">>" operator for a user-defined type
Hi, I have a Location class in my project, and I need to read a Location object by using cin >>, eg: Location locationObject; cin >> locationObject; I'm wondering if there is a way to overload the >> operator for a user-defined type like this. I trid to code the overloading method: istream& operator >> (istream& is, const Location& addLocationObject) { return is >> addLocationObject; } The compiler does not complain, but there is a error at runtime when the >> operator is called: "Unhandled exception at 0x00414219 in C++Project.exe: 0xC00000FD: Stack overflow." and it's pointing at the second line of the method above. Any suggestion Thanks in ...Show All
parivesh Renaming a form
Hello I create a new project using Visual C++ 2005 Beta 2 (CLR : Windows Forms Application) I obtain a form named "form1" I want to rename it "main". The problem is that I obtain this message "the project is out of date" How can I resolve this problem Thanks I must be doing somthing wrong. Whenever I rename form1 I have to go through all of the source files and replace the "form1" string with whatever I renamed it to. There has to be an easier way. Ok, the steps are: 1- I create a new project (Visual C++, CRL : Windows Forms Application) in visual studio.net (2005 beta2) and I name it “myproject” 2- I obtained a form “Form1” 3- In the solution explorer I clicked with the right button of ...Show All
Bondforever Calling C# from unmanaged C++
I've been searching a bit and I'm just getting twisted around about what I need to do here. Apologies if this has been answered many times, but I haven't been able to find it. I have a C# class library containing a form called DisplayWindow. It is being built succesfully. Now, I'd like to be able to call my DisplayWindow form to load from some C++ code. Once loaded, I'll be making additional calls into the DisplayWindow from C++. I've seen some examples using COM, but that doesn't look quite like what I want to do. Also, I've seen some stuff for calling C++ from C#, and that looks much easier... Can anyone help with this Thanks! This is a fairly classic case of growing pains. Who's the boss As long as you keep your C++ app the ...Show All
gudel Smartbridge Alerts
I too am receiving the "entry point not found" message. I have very little technical knowledge and would appreciate assistance in any fashion. thanks. Helen McLaughlin I was getting the same error message after I installed IE7. The above link gave a fix which worked. The only difficulty I had was in finding the correct file. I did a search for Smartbridge from the Start menu in Windows and it pointed me to some program files to do with my ISP. Did as link said and all now works ok. Many thanks, Andy. I am too receiving the "entry point not found" message. I have very little technical knowledge and would appreciate assistance in any fashion. thanks. Xavier Gonzalez ...Show All
JohnSLG A native 'public class' or 'private class' in VC8
Specifying 'public class' or 'private class' for C++ class definitions is not part of the C++ standard. In a topic in the VS 2005 docs 'How to: Declare public and private on Native classes', it is suggested that this syntax is supported with VC8 for interaction with CLR ref classes and for specifying in a CLR assembly. However in the specific C++ language documentation for native classes, there is no mention of the possibility of prepending 'class' with either 'public' or 'private'. Furthermore where it is explained in the first topic above there is no explanation of what it actually means for native classes, other than the implied suggestion that it treats native classes like ref classes in CLR assemblies as regards ...Show All
GameDog WM_KEYUP event not working....
I want to get extended key (i.e. Enter, Shift, Del etc) pressed in the EditBox. I have added WM_KEYUP event for that but that event is not called. I don't know why I don't want to create sub-class of Edit. Can anybody let me know what can be the problem My method is: void CTest_WinDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default MessageBox("Key up called....."); CDialog::OnKeyUp(nChar, nRepCnt, nFlags); } Did you add a ON_WM_KEYUP entry into your dialog's message map If so and it doesn't fire that means the edit control eats those messages and you'll have to subclass the edit box to catch them. Or I guess you cou ...Show All
nzeemin Compile C++ code To .Bin File
Hi. can I compile C++ code with VC++ or VC.Net to a BIN file How thanks. thank you very much for your answer! about "ST20 ToolSet" I said that it doesn't generate OPTIMUM binary code. I will Search about *.bin & VC tools for my project. thanks "Simple Samples","Marius Bancila ", "Brian Kramer" thank you for answer! I think , MSDOS 5.0 had a function that converted exe to bin. but I'm not sure. didn't it You should have said in your original question that you don't know what a bin file is. It is not a common format and therefore it is used in a variety of ways. The only way to know what format you need is to read the documentation of the specific software that yo ...Show All
ajustin conversion from BYTE to string in C
Hi, i need to convert a byte array to string in C. but i dont know how to perform that code. plz some one help me with sample code. Another take on it: #include <sstream> #include <iomanip> using namespace std; // .. BYTE bytes[11]; // .. initialize the bytes ostringstream oss; oss << hex; for(int i = 0; i < sizeof(bytes); ++i) { if(i > 0) oss << " "; oss << "%" << setw(2) << setfill('0') << (int)bytes[ i]; } SendDlgItemMessage(hDlgOpen, IDC_LIST1, LB_ADDSTRING, 0, (LPARAM)oss.str().c_str()); Hi, i tried like that but i dont get the answer. i think so some where i have made ...Show All
