|
I can help you, but if you are usin sql server, Is Not better to use dts???
But if you want use the following functions.
CFile::Open
CFile::Read
And then Execute a stored procedure that decide if you need to Insert or Update the Table.
Only you need to select the best way to acces to SQL, ADO, DAO, OLEDB, etc
Best Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
A printer consists of three main parts: the case, the jammed paper tray and the blinking red light.
|
|
|
|
|
Hello,
Does anybody know how to build a networked application in a SDI? I've got a good example on how to build the application using simple dialog(I've found it on "MFC programming with Visual C++ Unleashed"), but I want to build using WINSOCK connection(defined in CAsyncSocket class) on SDI or MDI instead on simple dialog. In simple dialog, we create a derived class from CAsyncSocket and define a socket variable in the dialog class.
The problem is that I don't know whether the socket variable is belongs in the document or view class? where do I have to define the variable and how could I use the function on view?
Please help.
|
|
|
|
|
I have never tried to do what you are doing but if you are going to display info or need to place edit boxes etc in a view I would use the Document class to do all the networking work or even the MainFrame class.. and display your results or what not in the view. You would probably want to do some testing.. But I would start by making a SDI or MDI and create the type of view you want, CListView, CFormView etc.. then first try placing your networking code in the Document class for that view..
Hope this gets you pointed in the right direction.
Rob
|
|
|
|
|
thanks for the explanation.
|
|
|
|
|
What I am doing is:
in view.h:
SOCKET m_socket.
Then in view.cpp:
view::OnInitialUpdate()
{
WSAStartup();
m_socket = socket();
bind(); // if server
}
view::~view()
{
closesocket(m_socket);
WSACleanup();
}
Call the corresponding accept, receive, send function when certain event occures, either it's a user triggered event (certain menu item is clicked based on your business logic) or it's a FD_XXX event (for asynchronos socket event).
So, in my opinion, the socket should belong to the view. HTH
|
|
|
|
|
I need some English information about this ,please tell me the particular web sites,thank you!!
huang chun shen
|
|
|
|
|
Check here You can find info abaout several File Formats. I don't remember if it has Info about Word files....
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
My Task:
I am reading data coming in from an instrument over a serial port. The data is received as 2 char bytes (8 bits each) which I need to pack into the lower 16 bits of an int. The instrument sends high-byte low-byte.
What is the most efficient way to do this?
Some of my ideas are:
- assign the first char to the int and bit shift it 8 bits to the left( << 8) and then OR the result with the next 8 bits. This would fill the lower 16 bits but I am concerned about efficiency, which is my greatest problem.
[does an 8-bit shift left require 8 cpu cycles to do this shift?]
- I could also use a union with bitfields to but again I am not sure about efficiency compared to other methods.
- my last thought would be to use a void pointer to step through an array, but I am not completely sure how this would work.
Could anyone shed some light on this topic for me? I would appreciate any suggestions/comments.
Thanks,
- Merle
|
|
|
|
|
I would expect that the quickest way is this:
char l,h;
DWORD dwValue = 0;
dwValue= ((DWORD) h) << 8;
dwValue+=l;
of course, you could do that on one line if you liked. But, the point is that an ADD operation is going to be quicker than an OR. if you init your DWORD to 0, then the add and or are identical in their result anyway.
However, I wouldn't be very worried about speed here. Your data is coming from a serial port, and serial ports ain't that quick. So long as your CPU is faster than an 8088, you'll probably keep up however you do it.
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I'd go with shift - work is probably done in CPU registers, which are way faster than memory. OTOH, good compiler could optimize the code and keep union in the one of the registers as well. I believe both solutions will be fast enough - are you expecting this operation to be a bottleneck for your app?
Merle Pittman wrote:
my last thought would be to use a void pointer to step through an array, but I am not completely sure how this would work.
With void pointer you can't step through anything. You could do that with unsigned char pointer, but creating 16-bit int in memory will be probably slower than shifting (see above).
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hello,
in my current project, I need to store the original file path of files. But they can come from many unit types : FD, local HD, network HD, CD writer, DVD rom etc....
So, for a given computer (the local machine !)I need to know :
- The drive list
- the type of each drive
- the name of each unit (HD name, CD ROM name if one is inserted in the CD Reader..)
I did not find out how to do that in VC++, is there anybody out there who can help me , please ?
You guys, who are so smart I've a new question : how to know if a unit is a CD Writer, a DVD writer ?
Thank you very much for the so numerous and efficient answer ! (hope make me live !)
Best regards
Guy LECOMTE
|
|
|
|
|
For a start, check GetLogicalDriveStrings, GetDriveType and GetVolumeInformation.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
GetLogicalDrives -- returns a bitmask representing the currently available disk drives.
GetLogicalDriveStrings -- fills a buffer with strings that specify valid drives in the system.
GetDriveType -- determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.
The Win32_CDROMDrive WMI(Windows Management Instrumentation ) class represents a CD-ROM drive on a Win32 computer system. Check the MediaType property whose values are Values are:
"Random Access"
"Supports Writing"
"Removable Media"
"CD-ROM"
Atul
Don't they know that java is slow.
|
|
|
|
|
How to parse a Microsoft Word file, in order to display it's content without Word in my local machine.
Thanks.
rajim@phrasea.com
|
|
|
|
|
Pretty damn hard. The Word file format isn't offically documented. You might want to have a look at some of the open source Office products as they claim to be able to read Word files.
If you Word document is saved as RTF, then the job is a little easier as RTF is at least documented by Microsoft.
Michael
|
|
|
|
|
Michael P Butler wrote:
Pretty damn hard.
Yes it is tough. But if you want some info on the format check the Text / Documents section of Wotsit.
Atul
Don't they know that java is slow.
|
|
|
|
|
Thank you so much.
|
|
|
|
|
You can use the Rich Text Object Classes, This Classes supports Word Docs, You can Save in 6.0 Word Format and read word docs... Is a simple solution. Other solution is that you save the docs in RTF format from the MS Word....
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You might want to have a look at AbiWord. It's a multi-platform free software word processor that can read quite a few document formats, including MS Word (I think it's from V.5 and onwards).
It's GPL so it comes with complete source.
|
|
|
|
|
How to parse a Microsoft Word file, in order to display it's content without Word in my local machine.
rajim@phrasea.com
|
|
|
|
|
Hi,
I have a thread created as
_beginthreadex(NULL, 0,MyMainThread, this, 0, &the_lThread);
In that MyMainThread() i will create one more thread as
_beginthreadex(NULL, 0, MySecondThread, the_this, 0, &the_lThread);
In MySecondThread() i will call one function, in which i have
SendMessage(MainWnd,WM_THREADREFRESH,TRUE);
But when the control enters Sendmessage,application hangs..
anyone pl help me to solve this.
Neha
|
|
|
|
|
From MSDN docs for SendMessage:
If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message.
It seems that thread which created MainWnd doesn't process its messages in message loop.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
In other words, even with SendMessage, you still might need some type of message pump in the thread that created the window. Or at least some type of message retrieval code.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Let be explain me clearly.
My application is a exe,in that i call a dll function which has 2 threads as i referred before.In my application i have a while loop which gets & dispatchs the message.
2nd thread in the dll calls the one function in my application .when it calls that function i observed that it was not processing messages.
If i call that function form the 1st thread in dll,it just works fine.
could you pl help me..
Neha
|
|
|
|
|
Can you put the breakpoint in the WM_THREADREFRESH message handler? Is it actually reached when you SendMessage from 3rd thread?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|