|
use the _tcstoul() function to convert your string to the unsigned long data type.
I Dream of Absolute Zero
|
|
|
|
|
I had no idea this was possible. How do you convert the CString "Yeah baby! Let's go swimming!" to an unsigned long integer?
Is it just the memory address of the CString object that is assigned to ULONG?
If so, why not just use (ULONG)&String?
|
|
|
|
|
Terry O`Nolley wrote:
If so, why not just use (ULONG)&String?
As you may have guessed, I meant converting a string representation of a numeric value to ULONG.
I didn't see your sarcasm tag there Terry
I Dream of Absolute Zero
|
|
|
|
|
debutante wrote:
Is there a way to convert CString to ULONG???
see response to Terry's post above ^^^
I Dream of Absolute Zero
|
|
|
|
|
god,
that's not helping me much, can you point me to a sample of some kind or article ?
Stéphane
|
|
|
|
|
Hi,
I try to buid a client soft in C++.
The aim is to manage grid computing on database cleanning.
I want to run over the full database and to compare differents field with eatch other for each lines of the database (about 800 000 differents lines of about 30 or 40 fields each).
So the idea is to work like seti@home, a server part sending line by line to the clients and a the whole database given to the client and updated by this one every day with new lines.
Each time a client end the research for one id, it sent the result with http link to the server and get a new id to check out (maybee the big database update too).
My point is how to manage the huge database comparison, do I have to use XML (and then a XML file) ? or a huge ini file ? if xml which class should I use to do the comparison ?
Is my project totally crazy ?
Thanks for your help.
PS : for now I got the app starting and sending an icon in the taskbar (with the clock) and a menu where I can open a window or quit. Next is to set the priority level to low then to manage the data recuperation.
|
|
|
|
|
You will definitely use multithreading.
Kuphryn
|
|
|
|
|
sbouli wrote:
Is my project totally crazy ?
Yes (and as you appear by your subject line to be new to programming, it's downright insane), but it's also not explained very clearly, and you don't provide information on the environment you're working in, so it's hard for us to understand your requirements or help you solve the problem.
800,000 rows of 40 fields in a database isn't really all that big. If all you need to do is update or remove data based on particular criteria, why not just use SQL queries run from the appropriate database front end or client application?
If you need a copy of the database on each machine, why not look at SQL Server Replication?
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
hahahaha,
thanks ...
So the environment will be :
server : coldfusion no big deal here
clients : running in MS Visual C++ on différents windows computer (secretary ones and maybe commercials ones ;o).
The aim, NO USE of the MSSQL servers (4) running our main app, this grid trick is to work against multiple accounts from cheaters. They use real data and the only way for me to catch them is to find part of similarity between records. I already tried a coldfusion template running every 10 mn and checking one record at a time using the SQL server. Not really faisable, too long, not scalable, not changeable on the fly. With the grid computing way of working, I can have multiple clients working on differents id_members maybee with differents criteria. So it seems to me the best way to do it.
So, yes I am a beginner in C++, but I know quite well Coldfusion, not too bad MS SQL. And as a young little boy, I played with Turbo PASCAL and Assembler and C (no C++ at that time). So I hope being able to find part of code and some help on the web to manage something not too bad, what do you think ? should I stop now ?
Stéphane
|
|
|
|
|
Well, I'd look solving it differently. If you're looking for similar records (having data within given ranges or data belonging to a set of values), then I'd try and look for those using a SQL query first (in a program running on a separate machine to the SQL servers, and I would probably use ADO in VB6, or ADO.NET in VB.NET/C#, and stuff the results of a query into a RecordSet or DataSet as appropriate).
In the program, you can then scan through the smaller result set with more sophisticated algorithms to find the "cheaters".
And I think that trying grid computing is overkill for this application. Given good criteria in the SQL query to start with would surely reduce the nubmer of rows to check to a managable value.
I've regularly worked with million+ row databases, and done some *vaguely* similar stuff, and I've never needed to go beyond a straight single application.
I have to admit though, that the exact nature of your application eludes me. It sounds like you're doing a seti-style distributed application where you need to cross check the results, and the usual way to handle that is to distribute the same data to more than one client, and see if they match up. If they don't, you keep chucking it out until you get a consistent set of results, or you run that data through yourself.
(I also have to admit that I have no familiarity with programming CF, and I'm wondering exactly why you have it - it seems unsuited to this sort of application)
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
I got your point, let say I do a first selection using MSSQL or MYSQL, then I do a new check using others criteria on the new query. How would you handle this in C++ ? I mean, would you use specific data type for the query in C++ ? or specific way of working ?
I stick on C++ because I am playing around with it for a week now ....
Thanks for the time you spend reading my awfull english.
Stéphane
|
|
|
|
|
Well, to access a database using C++, I'd use the ADO libraries:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/pg_ado_programming_6.asp[^]
Note that you need a working familiarity with COM (Component Object Model) to make progress with ADO.
ADO allows you to run an SQL Query (and you can specify your own criteria as part of that), and store the returned results in a Recordset object, that you can look through and examine easily. Each fields in each row of the recordset is stored as a Variant object (it's a union of lots of different types, with a tag to say what type you need to look at).
I hope that link gets you started. I would note that using ADO is a lot easier from Visual Basic
There are also other libraries to access database from C++ - you can go lower level and use ODBC directly, or use the DAO library, which ADO superceded, but still seems reasonably popular to use from C++ programs.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Hi , i have a problem with documento of word, i open a my document with i have make 3 DOCVARIABLE, but with my application i can't to read name of this docvariable, if you have a examples for this problem
thank's
andfrr
|
|
|
|
|
hi,
i came across one of this indian language (kanada or canada i am not sure)software where when 'k' is typed their symbol for 'ka' is got and when 'u' is typed next to 'k' the symbol for 'ku' is got.
i tried to look into the font by selecting that font in wordpad and typed my name. I got junk!!! How does that software do what it does?The font is .ttf
i am very intrigued.
wolfgang schiffer
|
|
|
|
|
Hi,
I have a DSN=test and the user is karteek and password is null.I want to connect to a Mysql database in linux system.Please provide me the required database functions.Please provide the code if possible.
Karteek
|
|
|
|
|
The easiest would probably be to derive a class from CRecordset . ClassWizard or AppWizard will prompt you for the name of the DSN. At that point, you can select the table(s) you want to associate the record set with.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi
i making a program to make dial-up connection and connecting to the net ,i dial with numbers stored in database , i use win API
like(InternetDial() ,InternetHangUp()), but i have two problems
1)InternetDial is dialing with default network connection on pc.
i need to make it taking numbers from database.?????
2) i want to create a new dial-up connection on pc, idont now what function i can use
thank u for advanced help
send me on hz_csharp@hotmail.com
|
|
|
|
|
hi
i have to insert multiline text item into listctrl and increase the height of that perticular row... can anybody tell me some suggestion....
thanx
|
|
|
|
|
One solution is to derive a class from CListCtrl and do custom drawing. Check out CodeProject code section for examples.
Kuphryn
|
|
|
|
|
I have a client application which playbacks remote video files time-synchronous. I used CAsyncSocket derrived class for TCP/IP transaction.
In order to display video frames time-synchronous I have to place "Sleep(...)" method in OnReceive(...) procedure. But "Sleep(...)" method blocks message processing of main thread in specified time-period, so the application is not responding the mouse and keyboard events or responding with 30-40 second delay. Because the socket generating messages heavily.
So, I used PeekMessage(.....), TranslateMessage(...),DispatchMessage(...) in specified time-period instead of Sleep(...) method in order to proceed messages during waiting period. It is working correctly. I filtered a lot of message that may be dangerous to dispatch in OnReceive(...) procedure. Everything seems OK. The mouse and keyboard messages are being handled correctly.
But I noticed a strange behaviour; there is a drop-down list box in the main window. Normally, the selected item of drop-down list box should change when mouse pointer comes over (without clicking). But it is not working. Selected item (blue printed item) does not change when mouse pointer comes over.
I thing, It is dispatching all messages except some socket messages in OnReceive(...) procedure. What may cause this problem. Does anyone have an idea.
Thanks.
Erkan Ermis
Erkan Ermis
|
|
|
|
|
Selected item (blue printed item) does not change when mouse pointer comes over
It maybe processed in IsDialogMessage()...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
|
|
And what is your f-ing problem?
What 40 years have to do with your question and my answer?
$6000/month? Idiot: +/-$6000 is usual for 5 minutes off my stock account fluctuations.
Now: you get back to work -- sun is high enough...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hi,
i've just installed VisualC++ on w2k.
Everything is fine apart from the setup of the symbols which fails due to inconsistency between many .dll present of my w2k and the files to be installed.
Any idea on how to solve the issue?
Thanks,
Teo
|
|
|
|