|
mbcvamsidhar wrote: CSV is just a text file...You cannot perform any operations on that.
Sir, it is possible to perform operations on that. Atleast query operations. This can be done by using the xls driver. (select * from Sheet1 where blah blah).
mbcvamsidhar wrote: 2.How it is parsed...(with coma,semicolon, space,tab etc)
CSV = Comma separated values. Parsed with comma.
Regards and Thanks
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Sir, it is possible to perform operations on that. Atleast query operations. This can be done by using the xls driver. (select * from Sheet1 where blah blah).
Can you Give me the syntax ....how to connect..etc
Thanks and Rgds
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
You can use the ODBC Text file driver to query the csv directly. However, it only gives you read access to the csv.
onwards and upwards...
|
|
|
|
|
Yes master,
I am using the same. But what would be the sql query format? SELECT * FROM what WHERE ...
Thanks and Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Example assumes that the CSV file is C:\Data\MyData.csv:
select * from C:\Data\MyData.csv
Also, using the ODBC DSN config utility, you can define the names and data types of the columns in the file. If you do this, you can access the column names in your sql statement and get back converted data types. Otherwise, I believe it just returns columns named F1, F2, F3, etc, all being varchar(255).
onwards and upwards...
-- modified at 9:44 Thursday 29th December, 2005
|
|
|
|
|
Hai,
Iam developing VC application which Selects any .MDB Database(MS-Access).
The requirement is..My Application should popup the list of Tables which contains primaryKey.
Can you pls tell me how to the retreive each table information in Access. (From MS-SQL i acheived this..using SQLGetPrimaryKeys()).....!
But this API is not Supporting For Access...
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
Hi,
I looked at the asm code in VC Disassembly for the following codes:
i++;
i = i+1;
Both are same.
10: i++;
0040D75F mov eax,dword ptr [ebp-8]
0040D762 add eax,1
0040D765 mov dword ptr [ebp-8],eax
11: i = i+1;
0040D768 mov ecx,dword ptr [ebp-8]
0040D76B add ecx,1
0040D76E mov dword ptr [ebp-8],ecx
But I studied in my computer classes that i++ is faster than = i+1.
How?
Thank you.
- NS -
|
|
|
|
|
it depends on the context.
like for example
k = somefunctioncall(i+1);<br />
i = i +1;
or
k = somefunctioncall(++i);
so here the secound one is faster than the first one
-Prakash
-Prakash
-- modified at 6:22 Wednesday 28th December, 2005
|
|
|
|
|
It has been a while since I did any C++ admitidly, I'm sure that the second example will pass a difference value into somefunctioncall because i++ is a postfix operation, i is passed into the function then updated, while i+1 will evaluate first then get passed into the function.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
yeah i know, I made the mistake
Thanks
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
|
|
|
|
|
Mr.Prakash wrote: Thanks
-Prakash
-Prakash
is my vision get blurred
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
The asm is
11: ++i;
0040D788 mov ecx,dword ptr [ebp-8]
0040D78B add ecx,1
0040D78E mov dword ptr [ebp-8],ecx
12: i = i+1;
0040D791 mov edx,dword ptr [ebp-8]
0040D794 add edx,1
0040D797 mov dword ptr [ebp-8],edx
13: fun(i+1);
0040D79A mov eax,dword ptr [ebp-8]
0040D79D add eax,1
0040D7A0 push eax
0040D7A1 call @ILT+5(fun) (0040100a)
0040D7A6 add esp,4
14: fun(++i);
0040D7A9 mov ecx,dword ptr [ebp-8]
0040D7AC add ecx,1
0040D7AF mov dword ptr [ebp-8],ecx
0040D7B2 mov edx,dword ptr [ebp-8]
0040D7B5 push edx
0040D7B6 call @ILT+5(fun) (0040100a)
0040D7BB add esp,4
15: fun(i++);
0040D7BE mov eax,dword ptr [ebp-8]
0040D7C1 mov dword ptr [ebp-0Ch],eax
0040D7C4 mov ecx,dword ptr [ebp-0Ch]
0040D7C7 push ecx
0040D7C8 mov edx,dword ptr [ebp-8]
0040D7CB add edx,1
0040D7CE mov dword ptr [ebp-8],edx
0040D7D1 call @ILT+5(fun) (0040100a)
0040D7D6 add esp,4
There are more instructions where ++ operator is used. Then how can we say that ++ is faster?
- NS -
|
|
|
|
|
U r wrong the case is vice versa
Tough to Belive
Assembly code to prove my observations
<br />
507: Add(++i);<br />
004010CE mov eax,dword ptr [ebp-4]<br />
004010D1 add eax,1<br />
004010D4 mov dword ptr [ebp-4],eax<br />
004010D7 mov ecx,dword ptr [ebp-4]<br />
004010DA push ecx<br />
004010DB call @ILT+15(Add) (00401014)<br />
004010E0 add esp,4<br />
508: Add(i+1);<br />
004010E3 mov edx,dword ptr [ebp-4]<br />
004010E6 add edx,1<br />
004010E9 push edx<br />
004010EA call @ILT+15(Add) (00401014)<br />
004010EF add esp,4<br />
506: Add(1+i);<br />
004010CE mov eax,dword ptr [ebp-4]<br />
004010D1 add eax,1<br />
004010D4 push eax<br />
004010D5 call @ILT+15(Add) (00401014)<br />
004010DA add esp,4<br />
507: Add(i++);<br />
004010DD mov ecx,dword ptr [ebp-4]<br />
004010E0 mov dword ptr [ebp-5Ch],ecx<br />
004010E3 mov edx,dword ptr [ebp-5Ch]<br />
004010E6 push edx<br />
004010E7 mov eax,dword ptr [ebp-4]<br />
004010EA add eax,1<br />
004010ED mov dword ptr [ebp-4],eax<br />
004010F0 call @ILT+15(Add) (00401014)<br />
004010F5 add esp,4
AS far as i think this is compiler dependent
i dont know the reason
But this is surely true if we pass some object in function
as lots of mechanismis involved to create and destroy object
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
SomeFunc(i+1)
is NOT the same as
SomeFunc(++i)
because in the first case, you do NOT modify the value of i .
I think you missed that, as the argument degraded over time...
It started
i = i + 1;
and
i++;
or
++i;
all of which will modify the value of i
Marriage slows down your coding, a baby slows it down even more!
|
|
|
|
|
Can u also tell how did ur computer teacher
said it was fast .
(There is always have a question HOW ?)
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
It was about ++ uses inc instruction...
- NS -
|
|
|
|
|
Yeh ur absolutely right there is a INC
machine instruction but unfortunalty
our vc++ compiler dont use it .
Might be it is not a part of 486 instructin set
or we dont know how make the compiler use it .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
-- modified at 6:34 Wednesday 28th December, 2005
|
|
|
|
|
in x86 instruction set there are 2 ways of incrementing a value
say
mov ax,[varname]<br />
add ax,1<br />
mov [varname],ax
or
mov ax,[varname]<br />
inc ax <========= adding a value one to the var, this way it is faster than add instruction<br />
move [varname],ax
this generation of instruction will be dependent on compiler and compiler settings (debug, release or optimised, etc)
in this case the VC compiler is generating same instructions for both cases.
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
|
|
|
|
|
NS17 wrote: But I studied in my computer classes that i++ is faster than = i+1.
any decent compiler will treat i++ and i=i+1 as identical, when optimizing.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
There are a couple of cases to look at here.
First, if the variable 'i ' is an integral type*, most compilers will optimize them to the same machine language. In a release compile, that might be a single 'increment' instruction, if the variable is currently held in a register. The example you found has the variable stored on the stack. * An integral type includes char , int , short , and long .
In the general case, where i is an object from an arbitrary class, the answer depends upon the implementation.
The code for i++ calls the copy constructor followed by the increment operator for the class.
The code for i = i + 1 calls the addition operator and the assignment operator for the class. Depending upon the definition of the addition operator, an additional call to the copy constructor may be required.
In practical terms, I wouldn't worry about which was more efficient. Most of the time, you'll choose the operation based upon which one makes the code more readable. In a simple for() loop, the increment form i++ is preferable. If this is part of logic that can change the variable by steps other than 1, then the assignment form i = i + 1 is more readable.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
Hi I have a problem.....
Actually i wrote a code which runs in service and hides in tray icon when minimized or closed...
When iam testing it by executing, its working , after when i restart the system to make run in service..
It is visible in service ,But No tray icon is Visible
If i keep any message Box in OnCreate() function ,
Then it's Working ...
Please help me...............
Some one told me that i have to Reset the tray icon for every one minute.
how can it been done...
or any other Answer
Thanks
|
|
|
|
|
|
any other way please help me your views and xperience not the reference
Thanks in Advance
|
|
|
|
|
Why are you creating a service with a UI? Before even trying to track this down, are you sure this is what you want? A true service should run without any need for a user context or interface.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I used VC++ CImage class to display a transparent PNG picture.
But its background that should be transparent, display a semi-transparent white layer.
How could I fix these problem ?
|
|
|
|
|