How to set WS_CLIPSIBLINGS on an edit control? Why can't we achieve that by dynamically creating the child controls on the dialog
Thanx,
Ch.T.Gopi Kumar. Tag: Visual C++ General Small executables Visual C++
newbie to VC++ wanting to work only Note that VC is more than a compiler; it is also an IDE that includes many tools. As far as standards compliance is concerned, that is relevant only to the compiler. The VC compiler conforms to the standard well enough that you are unlikely to be affected by any non-compliance.
I don't know what SGI STL is so I don't know how different it is from the standard STL but other than that the only requirement you have stated is that you need a compiler for standard C++. VC of course satisfies the requirement to compile standard C++. I think that for learning purposes, most C++ compilers are good enough. VC is of course very powerful in many ways. It is definitely worthwhile to be familiar with Visual Studio and will make learning easier. Also, there are many employers that will consider experience with Visual Studio to be important.
Is it not redundant to stay "Standard C++" .... "with STL" Tag: Visual C++ General Small executables Visual C++
mime protocol in c++(non visual c++ and mfc) Then you probably need to ask folks in http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.networks&lang=en&cr=US for better suggestions Tag: Visual C++ General Small executables Visual C++
C/C++ function to remove directory Hi,
Does anyone know the C/C++ function to remove directory(s) from the file tree I think there are functions for this feature as a keyboard has the feature using Delete or Shift+Delete keys.
Thanks, Renee. Tag: Visual C++ General Small executables Visual C++
Visual Studio Compile Settings Unfortunately not one of these options worked.
I still get an error that suggests reinstalling the applicaiton when I try to run it.
I want this to run as a simple C++ application so it can run on any machine that can handle '.exe'.
Why can't I compile simple C++ code in Visual Studio 2005 and have it work on other machines
Surely, Bloodshed Dev C++ compiler is not more compatible than MS Visual Studio 2005 !!
And thanks for the quick responses to the 2 above!
- Rick Tag: Visual C++ General Small executables Visual C++
Problem With Classes Hello, I have 2 classes in one namespace and each of these needs to have an instance of the other, like below: namespase myspace { ref class a { int fun1(){ b ^ instanceof_b;} }; ref class b { int fun2(){ a ^ instanceof_a;} } } ................................................... why it dont work and what should do to have such a relations Tag: Visual C++ General Small executables Visual C++
Serial Port programming using Visual studio .NET 2002 Enterprise Yes, at home i use VC6 (no ,NET). Current at my work place, i use a new installation of visual studio.NET 2002 Enterprise = VC7
problems complain by the complier,
Could not find HANDLE, DWORD, COMMTIMEOUTS, DCB, GetCommState... so on and so for for the various instant needed to initialise the serial port. I'm puzzled by that because I have added the <Windows.h>. By right that should do the trick. At home it can compile and work. At work place it fails.
Below is part of my code sample. should be easy for u guys.
#include <Windows.h> #define BUFSIZE 128
int main(int argc, char* argv[]) { DCB myDCB; COMMTIMEOUTS myTimeout; DWORD bytesWritten, commStatus; HANDLE hcom; /*Specify the Serial Port to be Used "Com#" Where # is the Port Number*/ char myPort[] = "Com4"; char myData[100]; /*Open Comm Port with Read/Write access, Exclusive Access, No Security, Open Existing No Overlapping IO, NULL Handler*/ hcom = CreateFile(myPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if (hcom == INVALID_HANDLE_VALUE) { printf("Serial Port Open Error: %d\n",GetLastError()); return 0; } /*Setup Comm Port Input and Output Buffer Size*/ SetupComm(hcom,BUFSIZE,BUFSIZE);
/*Get Default DCB Values and Overwrite Required Values*/ if(GetCommState(hcom,&myDCB)==0) { printf("Serial Port Values Unavailable\n"); } else { myDCB.BaudRate = CBR_9600; myDCB.ByteSize = 8; myDCB.Parity = NOPARITY; myDCB.StopBits = ONESTOPBIT; myDCB.fAbortOnError = TRUE; myDCB.EofChar = 10; if(SetCommState(hcom,&myDCB)==0) { printf("Unable to write Serial Port Configuration Values\n"); } else { GetCommTimeouts(hcom,&myTimeout); myTimeout.ReadIntervalTimeout = 50; myTimeout.ReadTotalTimeoutConstant = 50; myTimeout.ReadTotalTimeoutMultiplier = 10; myTimeout.WriteTotalTimeoutConstant = 50; myTimeout.WriteTotalTimeoutMultiplier = 10; SetCommTimeouts(hcom,&myTimeout); printf("Waiting for Data\n"); SetCommMask(hcom,EV_RXCHAR|EV_ERR); WaitCommEvent(hcom,&commStatus,0);
if (commStatus & EV_RXCHAR) { ReadFile(hcom,&myData,20,&bytesWritten,0); printf("Data Recieved: %s\n", myData); } else if(commStatus & EV_ERR) { printf("Error Reading From %s", myPort); } } } CloseHandle(hcom); getch(); return 0; } Tag: Visual C++ General Small executables Visual C++
DLL deployment error -2147010895 (0x800736B1) Well, IIRC you are running into user account control problems with these apps. So you are going to have to deal with it appropriately in Vista.
For the self registering, I think there was a post on here before saying that the copying of the vcredist is actually done after the registering of the COM libraries. If this is the case then you have two options, put your DLL registration code into a reg file and merge that, or provide a custom action later in the installer to run the registration. Well, in theory any process of writing the values to the registry after/without depending on the CRT would work. Tag: Visual C++ General Small executables Visual C++
CanĄŻt use compiler options correctly Thanks for your replies.
@Bite Qiu
IĄŻm a real novice and not compliant with the rules here. I first placed my message to the Ą°Building Development and Diagnostic Tools for .NetĄ± area because I could not found a proper forum for my question and then someone placed the message here. Actually IĄŻm not working with any graphical IDE and for the time being I donĄŻt want any because I donĄŻt like this Ą°remaining under the hoodĄ±.
@Holger Grund
Yes I did mean Ą°less typing on the commandĄ± and there is such a batch file and there are even several shortcuts for the different platforms like Windows 2000, XP, Server 2003 and 2008 calling this file so I thought I need not to care about anything but things didnĄŻt work like I expected them to work. I hope I will not be thrown out by the MSDN community by writing the following . In Java you just need two variables and access to the compiler and you got the full functionality of the standard API therefore I searched the batch file for such (similar) variables to avoid writing out every single search path but the file was really overwhelming, I didnĄŻt know what to extend. Now IĄŻll try your suggestions outĄ Tag: Visual C++ General Small executables Visual C++
Difference in Destructor calling mechanism between vc++ 6.0 and vc++ 2005 Hi, I tried to compile the above code with GCC also. Latest GCC compiler also shown same error as visual studio 6.0. And visual studio 2005 compiles this code successfully. Can anyone tell me what is the reason behind this Is it an error with Visual Studio 2005 Or did Microsoft deliberately done this for some reason Thanks and regards, Amal P. Tag: Visual C++ General Small executables Visual C++
How do Windows API file functions still have access to deleted files? > I think you are entangled yourself!
> You deleted file from one location, and reading this file from another location!
The files I deleted is in C:\Program Files\<My Application>\
The Application path I started is in C:\Program Files\<My Application>\
The path used in the application for the deleted files is also C:\Program Files\<My Application>\
I do not use relative path. The path used in API is "C:\Program Files\<My Application>\..."
This VIsta Computer is used for testing only. There is no other place where I put any files of my application. Tag: Visual C++ General Small executables Visual C++
code can't work in release build Hi All,
With related to this post, May I know the detailed Difference between the "DEBUG" and "RELEASE" build in VC++.
I tried to search in MSDN forums. No Luck...!!!!!!! Would really appreciate any useful weblinks/references.
Thanks in advance. Tag: Visual C++ General Small executables Visual C++
passing a string from/to vba/c++ dll Hi Josje,
Are you tring to have a c++ implementation of NextWord function If so, following code may help you:
Code Snippet
#include <iostream> #include <string> using namespace std;
string NextWord(string &Text,string Delim){ string tmp; int index;
index = Text.find_first_of(Delim); // Find the position of first delimiter if( index == -1 ) // Did not find the delimiter { tmp = Text; // Text is a single word Text = ""; // Make Text a empty string return tmp; } else if( index == 0 ){ // Has leading delimiters int posDelim = Text.find_first_not_of(Delim); Text.erase( 0, posDelim ); // Erase leading delimiter index = Text.find_first_of(Delim); // Find the position of first delimiter again }
tmp = Text.substr(0,index); // Get the string before the delimiter Text.erase(0,index+1); // erase the delimiter and the string before it
return tmp; }
int main(){ string Text = "passing a string from/to vba/c++ dll\nNext line"; string Delim = " /\n"; while( !Text.empty() ) cout << NextWord(Text, Delim) << endl; }
hope it helps
rico Tag: Visual C++ General Small executables Visual C++
Visual Studio 2005 professional: mspdbsrv failure -> Sporadic fatal error C1033: cannot open program database I'm also having this problem. I am compiling multiple exe projects within one solution. Is there a workaround or a bug report number that we can follow to get more information about this. Personally I like to delete the Debug/Release directory and try again. There is no need for me to restart VS. Tag: Visual C++ General Small executables Visual C++
Location of a DLL Jason Wilborn wrote:
Second, thanks for the link to the article, but I must apologize as I must be asking the wrong question or wording my question wrong. That article repeated many other microsoft articles and help pages that keep saying there is an order of locations that windows looks for a DLL. System32 is always listed yet when I put a DLL there it says it can't find it. SetDLLDirectory, if I'm understanding the function's intent will just add another place for windows to look. But if I want to just drop the DLL in System32 I don't see why I'd have to add code to specify System32. I guess my question should be worded, how do I make windows, from within my application when it calls a DLL, do what all the microsoft help pages say it's suppose to do Or maybe someone can tell me what part of the search order I'm misunderstanding because when I read it, I'm taking away an understanding that windows is going to actually look in those locations. Does it or does it not Or does it search those locations only if you tell it to
It does search those locations, that's a safe bet. The problem is likely to be caused by other factors.
How exactly are you loading the dlls Also, did you include a manifest with them Tag: Visual C++ General Small executables Visual C++
Running a very simple Win32 app on a comp without VC++ 2005 Express OK, due to popular demand, and my frustration with seeing so many people using Express that simply want to run an app on another machine, without the hassle of learning about merge modules, Windows Installer, etc, etc, etc, here is a way to perform deployment option number 2 above (i.e. installing C Runtime library applocal) for Express. 1) On the machine you have Express installed, create the following folder and subfolders in your \program files\microsoft visual studio 8\VC folder: redist\x86\Microsoft.VC80.CRT 2) Copy msvcr80.dll, msvcp80.dll, msvcm80.dll from \windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd into: \program files\microsoft visual studio 8\VC\redist\x86\Microsoft.VC80.CRT 3) in the above Microsoft.VC80.CRT folder, create a new file named: Microsoft.VC80.CRT.manifest 4) Paste the following content into the above manifest file: < xml version="1.0" encoding="UTF-8" standalone="yes" > <!-- Copyright c 1981-2001 Microsoft Corporation --> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <noInheritable/> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> <file name="msvcr80.dll"/> <file name="msvcp80.dll"/> <file name="msvcm80.dll"/> </assembly> Now you have a new folder in your Visual C++ Express installation that can be re-used when ever you need it. To deploy these files, simply copy the Microsoft.VC80.CRT folder you just created to your program folder. That's it. So for example, if your application executable resides in C:\Program Files\MyApp, you'll have a folder named: C:\Program Files\MyApp\Microsoft.VC80.CRT that contains the 4 files I mentioned (3 DLLs and one manifest file you created by hand) No installation of anything else is necessary. Just click on your EXE file, and your app will run. No special installation engines are necessary, just make your setup program (installer) create that subfolder Microsoft.VC80.CRT along with what you normally install with your app) Let me know if you need similar instructions for MFC and I'll create them. Tag: Visual C++ General Small executables Visual C++
more Textboxes saving to a file I have to do a singly linked list,with windows forms application, i have till now this: I have in the main Form1 some buttons, when i press the first button i open a new form2 and in this one i have 2 textboxes in which i fill the data (name and age) , i have problem saving the text from the 2 textboxes to a .txt file, and when i put some other data in the textboxes i want my old records that are in to be still in it. Example: name: prima //the first 2 records age: 18 name: prima2 // the second ones age 188 Tag: Visual C++ General Small executables Visual C++
"Goto Definition" sometimes doesn't work Just in case, please report the issue through http://connect.microsoft.com
Also, please reply back with the bug link.
Thanks in advance for taking the time to log the issue!
Thanks,
Ayman Shoukry
VC++ Team Tag: Visual C++ General Small executables Visual C++
[Help] Out of Memory I know what you want to do. I think that you can use several tables in class which have a overload operator[] and it can manipulate tables. But don't how you can use continued memory Tag: Visual C++ General Small executables Visual C++
Re-Building VS6.0 apps with VS'05? Thanks for the link. Although I had to dig a bit deeper, it pointed me in the right direction. The need for a dependancy Manifest in the install folder is foriegn to us VC6.0 -> VC2005 types I guess.
Thanks for both answers... Tag: Visual C++ General Small executables Visual C++
Comapring strings? TilakGopi wrote: Use strcmp function to compare the input string with the valid string("Help") in ur case. When using a C++ standard string as in string("Help") there is the "==" operator that can be used instead of strcmp. Tag: Visual C++ General Small executables Visual C++
Importing, compiling and running source code Hello
Re: Importing, compiling and running source code
I am going to mark this thread as answered since you have not followed up with any further information on your problem - I assume you solved the problem yourself or one of the suggestions in this thread helped you solved the problem. If you have a solution you could post it so others can find it. If you do not have a solution then please submit further details and then mark the thread as unanswered.
Thanks
Damien Tag: Visual C++ General Small executables Visual C++
DLLMain defined in .obj file? According to MSDN documentation, the DllMain function is "an optional entry point into a dynamic-link library (DLL)." [ http://msdn.microsoft.com/library/default.asp url=/library/en-us/dllproc/base/dllmain.asp ]. Therefore a DLL does not seem to need the DllMain function.
Tag: Visual C++ General Small executables Visual C++
Change in behavior of properties from VC7.1 to VC8 Ah - I answered without checking first. Bad.
Entering $(ProjectDir)\ does not bring up any autocompletion. Entering $(ProjectDir)\..\ still brings up the wrong tree relative to the install directory.
In 7.1 I could enter ..\ and it would provide auto completion directories relative to the project. So far nothing works correctly for auto completion in 8.0 Tag: Visual C++ General Small executables Visual C++
how to use .swe database does anyone knows how to access or update data from a ( .swe ) database using MFC
tanks a lot Tag: Visual C++ General Small executables Visual C++
IXMLHttpRequestPtr and OndataAvailable Hi
I have to implement Asynchronous data download using IXMLHttpRequestPtr. Please let me know if it is possible and how do I implement OnDataAvailable.
How does IXMLHttpRequestPtr get hooked to OnDataAvailable
The application that has been develeoped is ATL control for Drag and Drop attachement from Mail Server.
When the data is being downloaded from the server it should download in chunks of data as and when it is available.
The data will be taken in IStream using IXMLHttpRequest::get_responseStream currently it uses IXMLHttpRequest::get_responseBody(VARIANT)
Please help and suggest, please send code snippets and implementation details.
Thanks Alpana Dhole Tag: Visual C++ General Small executables Visual C++
MFC-How to add CDialog into CPropertySheet PareshC Thanks. I know CPropertyPage can make it, but I want that CDialog could be added like CPropertyPage into PropertySheet.
Pintu
Excuse me. I don't understand why you post part of description from MSDN. I know " CPropertySheet is not derived from CDialog " and I can't find any parameters in constructor would be helpful for me.
I show part of my code
In .h file
CPropertySheet m_sheet; CSmallDlg m_dlg; ( CSmallDlg is derived from CDialog)
In .cpp ( )
BOOL CPropertySheetTestDlg: nInitDialog() {
.
m_sheet.AddPage((CPropertyPage*)&m_dlg); m_sheet.Create(this,WS_CHILD|WS_VISIBLE,0);
.
.
}
It will crash in "m_sheet.AddPage((CPropertyPage*)&m_dlg);" because of
void CPropertySheet::AddPage(CPropertyPage* pPage) {
. ASSERT_KINDOF(CPropertyPage, pPage); <-- this .
}
Is it possible to make it Tag: Visual C++ General Small executables Visual C++
C3851 compiler error Hello,
I need to define a long string constant (>500 chars) that contains some illegal characters. The equivalent C# syntax is something like
Code Snippet
String s = "\u0024\u006D\u007C\u002B\u006D\u0044\u0060\u0063\u006C\u0078\u0061\u0044\u0045\u007A\u005E";
The following syntax in C++ throws a c3851 compiler error:
Code Snippet
String^ s = "\u0024\u006D\u007C\u002B\u006D\u0044\u0060\u0063\u006C\u0078\u0061\u0044\u0045\u007A\u005E";
I have tried replacing \u with \x but I am not sure if that is completely equivalent
Any ideas
Thanks Tag: Visual C++ General Small executables Visual C++
Are the following two functions correct? Hello all: It is not good to return a reference or pointer to the local variable. My question is the function 'beginComment' and 'endComment' are correct functions If anyone is correct, why Thank you #include <iostream> #include <vector> using namespace std; const char * beginComment() { return "["; } const char * endComment() { char * p = "]"; return p; } int main( ) { cout << beginComment() << endl; cout << endComment() << endl; return 0; } Tag: Visual C++ General Small executables Visual C++
Where can I download old versions? I would try Visual C++ Express Edition - for more information see here . Tag: Visual C++ General Small executables Visual C++
How can I do asynchronous socket proramming in console application? I tried with following code... fd_mail = socket(AF_INET, SOCK_STREAM, 0); host_info.sin_family = AF_INET; host_info.sin_port = htons (110); host_info.sin_addr.s_addr = inet_addr(IPAddr); // Setup socket for asynchronous operation async_event = WSACreateEvent(); if(WSAGetLastError() != 0) return -1; int t = WSAEventSelect(fd_mail, async_event, FD_CONNECT | FD_READ | FD_WRITE | FD_CLOSE); int err = 1; err_code = connect(fd_mail, (struct sockaddr *)&host_info, (sizeof(struct sockaddr_in))); And before calling recv() for response from mail server which reads mail content I am using this statement DWORD ret = WaitForSingleObject(async_event, 1000); I just cant understand how this mechanism works.. Tag: Visual C++ General Small executables Visual C++
Never seen before problem with the old "This App Failed to Start, Config is Incorrect.." problem Hi all,
if you are reading this, and if you have the same problem about your app's exe couldn't find the required DLLs that it was set up to use, then here is the solution.
**Note** This solution is not new, and is from other people's method already available on the forum before.
(1) Open the app's exe's Manifest file, which is either a separate file, or embedded inside the exe, and check which version of DLLs it needs to use. Double check that the version number it requires is the same as the version number that your VS2005 is using (Go to Help>About in VS2005). They will be the same since you have built the app using your VS2005 !!
(2) On the target machines, you need to install those DLLs needed (the version that your app needs). This can be done by running the "vcredist_x86.exe" file found on your machine's "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86"
(3) After step 2, the target machine's C:/Windows/WinSxS/ folder should have the folders with the required DLLs inside. These newly added folders will have the required version numbers as part of their folder names, go inside and you should see those DLLs being the version that your app's exe needs (Just mouse-over the DLL to check its version number).
(4) Then your target machine should be ready to go !!!!!!!!!!!
Cheers!
David
(nickname: gon_no1) Tag: Visual C++ General Small executables Visual C++
Dato0011
Hello.
I'm working on a project where file size matters. I'm compiling an empty project about 6-7 kb-s. is there anyway to get smaller file
thanks, I know about packers. I will use them, but what I want is that I saw some compiled exe files which were 3 kb. so I wonder, is there any way i can compile exe files in such size using VS 2005
Managed executables are generally smaller than native executables, so you might have seen one of those. Other than that, there are a number of tricks you can apply to get smaller output, such as replacing the C runtime library. Articles and texts describing the procedures can be found on MSDN, CodeProject, Codeguru, and a bunch of other sites. For one, you can read through http://msdn.microsoft.com/msdnmag/issues/01/01/hood/.