|
Converting the contents to double describes it well.
Kyle
|
|
|
|
|
kyledunn wrote:
Converting the contents to double describes it well.
Then the solution is elementary.
Use atof(...)
double num = atof(buffer);
Hope that helped,
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
Yes, that did help. Thanks.
Kyle
|
|
|
|
|
How do you serialize an MFC POSITION data type and an HTREEITEM?
This questions from my dad. He told me to post it here so I can't get anymore detailed until he gets home.
-Raffi's dad
|
|
|
|
|
you don't. you find some other way to represent them. a POSITION is, well, probably just a number, an ordinal. an HTREEITEM is much more complex. if you want to serialize a tree, use something like XML, or come up with your own tree-like data structure.
-c
I don't care, and you can't make me.
|
|
|
|
|
Hey folks,
I've got a problem that I need help with, I've tried numerous approaches an have yet to find a "WHY" answer.
Some background..
In our product, which is just a big database, we've got our MAIN process which owns a big chunk of memory which holds all the TABLES, and various child processes which have READ ONLY access to those tables. All updates are done using a DATA-MANAGER thread in the MAIN PROCESS, where a child process will send a message to the MAIN process thread, telling him to update TABLEx, RECORDx, FIELDx with value Y, No problems...
We have 5-6 tables in the MAIN process which need to be READ_WRITE for all the child processes. This works fine in Windows 95/98/NT/2K, but in Windows XP, we're finding that child processes do not have READ_ONLY access to this memory.
Is anyone aware of any changes done to VirtualProtect in Windows XP?
Basically, when the memory is created/mapped in the MAIN process, we mark the memory area as PAGE_READWRITE... When we start a child process, we Map the same memory as PAGE_READONLY initially(OpenFileMapping, MapViewofFile) for the child process. Like I mentioned earlier, we have some tables that are LOCAL tables that do not go through the DATA-MANAGER-THREAD (which makes the update, then broadcasts it to the server app, etc, etc), that need to be READ-WRITE for the child processes.
When we populate the tables from the child process, if we encounter a table that's LOCAL, we change his permissions to PAGE_READWRITE:
if ( pcos->objc[*pclass].sync == LOCAL_TABLE )
VirtualProtect ( addressstart, size, PAGE_READWRITE, &prot );
In Win 95->2k, this works fine, VirtualProtect returns 1 (SUCCESS)... in XP, we get a 0, and a GetLastError(), as 47 (I think... INVALID_PARAMETER)...
For fun, we did a switch-eroo... We made the tables INITIALLY READ-WRITE for the child process, then made all tables that were !LOCAL_TABLES READ-ONLY... Fired up XP, BINGO, everything worked fine...
Is there a new rule in XP where you cannot UPGRADE the permissions when using a shared memory area, but only downgrade?
READONLY -> READWRITE failed, but, when we did the switcheroo
READWRITE-> READONLY, it worked...
Thoughts? Anyone have any direction here? Much Appreciated..
Mike
doner@obtain.com
|
|
|
|
|
Hi:
I registered a CListCtrl control in the Document class and catching (succesfully) LVN_BEGINDRAG notifications.
ON_NOTIFY(LVN_BEGINDRAG, IDC_VIEW_UNIVERSE_LISTBOX, OnBeginDragUniverseListBox)
All the hocus-popus is gone in this routine:
******************************
void CViewUniverse::OnBeginDragUniverseListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
*pResult = 0;
// Create the drag & drop source and data objects
COleDropSource *pDropSource = new COleDropSource;
COleDataSource *pDataSource = new COleDataSource;
CDocUniverse* pDoc = (CDocUniverse*) GetDocument();
int nItems = pDoc->m_ViewUniverseListBox.GetItemCount();
if (nItems > 0) {
// Get the number of columns
CHeaderCtrl* pHeader = (CHeaderCtrl *)pDoc->m_ViewUniverseListBox.GetDlgItem(0);
int nColumns = pHeader?pHeader->GetItemCount() ;
CString sDataString;
TRY {
CSharedFile mFile(GMEM_ZEROINIT|GMEM_DDESHARE|GMEM_MOVEABLE);
TRY {
CArchive mArchive(&mFile, CArchive::store);
TRY {
CString sItems;
sItems.Format("%i\n", nItems);
//mFile.Write(sItems, sItems.GetLength());
mArchive.WriteString(sItems);
for (int i = 0; i < nItems; i++) {
sDataString.Empty();
for (int j = 0; j < 3; j++) {
sDataString += pDoc->m_ViewUniverseListBox.GetItemText(i, j) + "\t";
}
mArchive.WriteString(sDataString + "\n");
}
mArchive.Close();
} CATCH_ALL(eInner) {
AfxMessageBox("eInner");
return;
} END_CATCH_ALL;
} CATCH_ALL(eMiddle) {
AfxMessageBox("eMiddle");
return;
} END_CATCH_ALL;
pDataSource->CacheGlobalData(CF_TEXT, mFile.Detach());
pDataSource->DoDragDrop(DROPEFFECT_MOVE|DROPEFFECT_COPY, NULL, NULL);
} CATCH_ALL(eOuter) {
AfxMessageBox("eOuter");
return;
} END_CATCH_ALL;
}
delete pDropSource;
delete pDataSource;
}
******************************
I ran it in debugging mode and the inputs are written to the file. But for some reason, the drag to Excel (or other application) doesn't work. Any clue?
Thank you.
|
|
|
|
|
Any Information need.
Also .. : how can i implement Phone calls thru Internet - to local telephone station in the world ?
thanks !
|
|
|
|
|
A lot depends on what kind of hardware you've got. A decent pabx/switch would take a lot of the hardwork away.
I've done a bit of work recently with the Intertel Phone Switch and the Flexion X300.
http://www.iptelephony.org/
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
Well , what about Voice communications thru Internet ?
Something like PallTalk, etc - did anybody have some info (links, sities, books)?
|
|
|
|
|
I've heard about possibility to connect from local Desctop software thru Internet to telephone stations , and make local calls .
Does it possible without any additional hardware ? I suppose they are not used any centralised I-net servers ?
|
|
|
|
|
You'll need something at the end of the line to convert the VoIP data into "voice data" for the PST to recognise. Of course if you have an IP keyset phone at the remote end, it will do the conversion for you.
I've never seen a software only solution as most of my work has been for specific pabx and switches.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
Does anybody knows any books/links/docs about programming Software for mobile phones ?
Samples, tools, equipments ?
|
|
|
|
|
symbian epoc
Normski. - Professional Windows Programmer
|
|
|
|
|
sorry .. i did not understand you .. ??
|
|
|
|
|
|
|
|
Hi Anonymous,
I am also interested in writing applications for mobiles. Maybe you can mail me and we can help each other.
vikasde@rediffmail.com
Best Regards
Sonu
|
|
|
|
|
I have tray aplication, and i want to create hot-keys combinations or it. How can i do it ?
|
|
|
|
|
|
MSDN says that if a point is in a region, the return is non-zero.
If a point is in a region, a window should be moved.
Why this if doesn t work:
if (PtinRgn(hRgn, LOWORD(lParam), HIWORD(lParam) != 0)
and this works:
if (PtinRgn(hRgn, LOWORD(lParam), HIWORD(lParam) == 0)
|
|
|
|
|
First I want to make sure that you are referring to the API PtInRegion.
Next, are you sure the region that you created is not the inverse of what you think it is? A good way to visualize a region is to get a device context, and call FillRgn right before you use it.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hello all,
I own Microsoft Visual C++ 6 Pro, and have been using it for some time.
I've created "Win32 Console Applications" but am interested in using the VC++ dev env to create true MSDOS programs.
Speciafically, I'm creating a DOS program that is going to access the serial port.
What's the best way to go about this? I've tried #include'ing <dos.h> but it doesn't seem to be the full featured library that is included with other DOS based compilers. Specifically, it's missing things like textcolor() and gotoxy().
Thanks for your help!
Xds
|
|
|
|
|
I think Microsoft doesn implemented those function. And with VC++6 you can only create Console apps.
All programs for DOS are console apps on Windows.
|
|
|
|
|