-
- How to write in a new line in a file in MFC?
by ketu0001
- 4 Replies
- Last post
by Viorel.
- Hi All
I want to write data in file using MFC Application.
How to add newline character for this I want to write each record in seperate line. each record consist of product ID and Product Name.
My Code is as below:
void CProductDlg: nButWrite() { // TODO: Add your control notification handler code here CStdioFile fileObj; CFileException fileException; CFileStatus fileStatus; char* szF
-
- The ParseDateTime will not work on some locale settings?
by Jerry Ou
- 0 Replies
- Last post
by Jerry Ou
- Hi All:
I have encountered a problem in time date format when changing user's locale, The code snippets are below.
COleDateTime DataTime; DataTime.ParseDateTime(strTime, LOCALE_NOUSEROVERRIDE);
The strTime is a CString variable, It likes "11/10/2007" or "25/10/2007" ....(the format is %d/%m/%Y)
Here is my testing environment. In my XP+sp2 en version OS. T
-
- Getting the pivot (windowing) century.
by Ryan McBeth
- 1 Replies
- Last post
by Aleksandr Tokarev
- To all,
I need to get the pivot date for a two-digit year from the Regional options that are found under:
Control Panel > Regional and Language Options > Customize > Date > Calendar.
This is the value which will switch a two digit date to this century of last century basde on the two digit date.
There doesn't seem to be an LCTYPE for getting that date under Ge
-
- Detecting subfolder names
by Celios
- 2 Replies
- Last post
by Celios
- Hi. I am trying to detect subfolder names inside directories. Inside a directory, I used FindFirstFile and FindNextFile and they can detect the subfolders, but the WIN32_FIND_DATA's cFileName does not give me the names of the subfolders. How do I do this Thanks, Celios
-
- How to extract flags from long value
by Koray Samsun
- 3 Replies
- Last post
by Koray Samsun
- Hi, i have an unsigned long value like 33557968 and want to extract set of flags (17 flags). How can i do that
-
- getting current user name
by cadouthat
- 5 Replies
- Last post
by Anonymous
- how can i get the name of the current user - is it in the registry is there a function
i want to do this in case i want to put something on the desktop or in my documents ect.
thanks in advance
-
- wlanapi.dll
by ReinerZ
- 3 Replies
- Last post
by Nelson
- Hi all,
I'd want to use the new WLAN-API's, described in the latest Platform SDK (wlanapi.h). I think this API is new to Windows Vista, but have found another thread in this forums, that points out that there is a version of WLANAPI.DLL, that is capable of running on XP SP2. Does anybody know, where I can get this DLL Or is there any other chance, to work with 802.11-networks on pre Vista-s
-
- Warning C4482 - Enums
by Steve Jackson
- 6 Replies
- Last post
by xpnctoc
- Maybe this isn't the correct forum, perhaps if I ask the question this way. Is there anything wrong with the way I am using the enum below FigureNames is simply an enum {jack, jill, etc..}. When compiling, it get the following warning;
Warning 2 warning C4482: nonstandard extension used: enum 'Names' used in qualified name c:\Documents and Settings\Steve Jackson\My Documents\MySchool\C++\A
-
- Icons in Solution Explorer
by Thomas2054
- 11 Replies
- Last post
by Nishant Sivakumar
- What does an inverse minus sign (small filled red circle with white '-' sign in it) next to a file in the Solution Explorer mean I would have included a jpg screen shot, but there does not appear to be a way to do that in this forum.
More broadly speaking, where do I find icon definitions for the Solution Explorer and other parts of VS 2005
I am using VC++ 2005 Express.
Thoma
-
- StoragePortClassGuid: What is it and where can I get one?
by DevanL
- 3 Replies
- Last post
by DevanL
- consider the following:
//Get list of all storage drivers hIntDevInfo = SetupDiGetClassDevs ( (LPGUID)&StoragePortClassGuid, NULL, //pDevId, // Enumerator NULL, // Parent Window (DIGCF_PRESENT | DIGCF_INTERFACEDEVICE // Only Devices present & Interface class ));
notice the use of StoragePortClassGuid in the call tolimit the results for hIntDevInfo. My problem is I am trying
-
- USA Daylight Savings Time (DST) Update - Yes updated but poorly
by Damien Watkins - MSFT
- 8 Replies
- Last post
by crescens2k
- Starting from March 2007, the Daylight Savings Time (DST) start date and end date for the United States will change. DST will start at 2:00 A.M. on the second Sunday in March and end at 2:00 A.M on the first Sunday in November.
The C Run-Time (CRT) performs its own time handling only when the TZ environment variable is set, or when an underlying OS API time call fails. If the TZ envir
-
- cannot find afxres.h
by Brock Rogers
- 2 Replies
- Last post
by Brock Rogers
- I'm using MS Visual Studio.NET version 7.0.9466 and .NET framewok 1.0. Whenever I try to add a class I get "fatal error RC1015: cannot open include file 'afxres.h'. I have verified that my include directories contain the location to that file but it's not recognizing it. I went into the registry and the vs install directory was pointing to C:\program files\blahblah\common7\ide\ ... I changed
-
- BSTR Strings
by Hooper
- 7 Replies
- Last post
by Simple Samples
- Hi,
I have an xml app where I am reading in the file and moving through the nodes, types.
I would like to print these items, elements, text, values, out to the console.
But when I do,
std::cout << bstrValue;
I just get what must be maybe an address.
Steping through in the debugger I can see the address and text, but I would like to print out the value for now.
And probab
-
- Compiler selecting template function in error?
by Simulacrum
- 7 Replies
- Last post
by Brian Kramer
- class A { ... A operator =(A &rhs); A template<typename T> operator =(const T &rhs); A operator -(A &rhs); } int main(void) { A number; A otherNumber; A result; number="123"; //calls templated operator = as expected otherNumber="321"; //calls templated operator = as expected result=number - otherNumber; //calls
-
- Multithreading Best Practice -Queueing
by A.Russell
- 14 Replies
- Last post
by A.Russell
- I have set up a thead that loops until it receives some data before processing it. It works well enough, however it uses a lot of CPU just while it isn't doing anything. What is the best way to deal with this situation
Code Snippet
//keep thread running all all the time while(true) { //wait for there to be work in the queue workQueueMutex->WaitOne();
try
-
- import txt, separate line with space, in string
by futurechromex3x
- 3 Replies
- Last post
by futurechromex3x
- im trying to import a txt document into my program and each line contains 1 word when i load it one way it only loads the last line(espionage), if i do it the other way it loads all the words unseparated(applebaseballcomputerdriveespionage). so how do i load the list and each word separated by spaces here is the text file "apple baseball computer drive espionage" here is the code to onl
-
- Why do I get "The transaction has already been implicitly or explicitly committed or aborted"?
by hdp203
- 6 Replies
- Last post
by cacosta
- Without using TransactionScope the code runs fine. With ts, the exception is throwed when I call Update(). Below is my code in C++: try { Transactions::TransactionScope^ ts = gcnew Transactions::TransactionScope(); SavePatient(hPatient, hProgress); ts->Complete(); } catch (Exception^ e) { MessageBox::Show
-
- fscanf won't read past first character
by &#42;Cole&#42;
- 8 Replies
- Last post
by Marius Bancila
- I am trying to read from a file using fscanf and it won't read past the first character. I was wondering if anybody could tell me why Here is the code, I pass the file many times to different parts of the program, perhaps I'm doing this wrong
Code Snippet
#include <stdio.h> #include <cstdlib> #include "Rational.h" using namespace std; //funtions void getConstrai
-
- Slider controls
by Andrew Ellis
- 3 Replies
- Last post
by Andrew Ellis
- Hi,
I have created an application in which I have 3 slider controls.
I can dectect when any othe the sliders controls is moving by detecting the WM_HScroll message. My question is how can I detect which one of the slider controls has been moved
Thanks
Andrew Ellis
-
- bug in arithmetic conversion?
by eric.slosser
- 14 Replies
- Last post
by eric.slosser
- I've found what I think is a bug in how the C compiler treats binary operators when the operands are of different types.
According the rules of 'standard arithmetic conversion', if one operand is a "float" and one is an "int", I would expect the operation to be performed with 'float' precision. The following code illustrates the bug.
Following was typed into a ne
-
- A compiing error about template
by AILAB
- 8 Replies
- Last post
by AILAB
- Dear Expert:
I use visual studio 2005 to compile NeuroLib ( http://www.ia.unc.edu/dev/ ), and
there are a lot of error like the following:
----------
e:\unc_proj\lib\neurolib\libraries\datatypes\Vector2D.txx(33) : error C2244: 'Vector2D<T>::{ctor}' : unable to match function definition to an existing declaration 3> definition 3> 'Vector2D<T>::Vector2D(const Ve
-
- Upgrading from Microsoft Visual C++ 6.0
by Humots
- 3 Replies
- Last post
by Bite Qiu - MSFT
- I would like to upgrade to Microsoft Visual Studio 2005. I currently have Visual C++ 6.0. Does Visual C++ 6.0 qualify as an upgrade for the Microsoft Visual Studio Standard 2005 Upgrade, or do I have to buy the whole package Thanks.
-
- 1st TIME USER, please help me to install the STK in Visual Studio 2005
by sneakBeats
- 4 Replies
- Last post
by Damien Watkins - MSFT
- Hello everyone, sorry if this is a stupid question, but I'm VERY new to this.
Have been bumbling through C++ at uni (it's a module on my Sound Tech course) but now it's Xmas holidays and there are no tutors to pester!
I've managed to get hold of Visual Studio 2005 and I need to know how to get the STK file working with it. My plan is to build a very simple interface that allows the user to m
-
- fatal error C1083: on relese only
by -anthrax-
- 9 Replies
- Last post
by -anthrax-
- hi guys,
I have a VC++ project which i have downloaded as a sample code which was originally written in VC++ 7.1. I'm using the evaluation copy of Visual Studio 2005 professional, whchi is still on evaluation perioud.
there was no problems in converting it in to VC++ 8 (2005) and also when running in debugging mode. it works perfectly fine.
as soon as i run it in relese mode i
-
- 'View' contents get lost
by sud_avr
- 8 Replies
- Last post
by Simple Samples
- Hi all, I am newbie to all this. This is what I am trying to do by creating n MFC application. Display a window with a view. Write some text to the view. But each time I minimize the window and restore it, I see that my view contents are lost. I tried using the functions UpdateWindow() and Invalidate() on the view. This is a function associated with the message map of my view. LRESULT CTe