|
Hi,
I Have an Access DB in a MFC App, I add a record (db.AddNew, ..., db.Update)
later when I set strFilter and open database it returns EOF
I opened DB manually in MS Access, created a SQL query and, the same thing!
I then Copy - Pasted the record and rerun my App and it's OK
It is when My app writes a record, it can't be accessed by filter later, but if I just copy-paste record everythings goes right
The column in my filter is of type TEXT, and in my filter if I use 'like' instead of '=' the record will be found!
Can any one give me a discription of my crazy access DB?!!
//This is not a signature
while (I'm_alive) {
printf("I Love Programming");
}
|
|
|
|
|
Copy of earlier post however I also implemented the app in C++/CLI. If you've already read this then just skip to the bottom. Also of note: Using VS2005 & profiled the C++ code.
Did some work for a friend over the weekend. Basic scenario was that he had a client who wanted to have a program built that processed some numbers. He wanted a test app built in Java, C#, VB.NET and C++. My friend had already developed the C# app so he sent me the code and I translated to C++. Initial testing looked like the C# app was as fast and sometimes faster than the C++ app...in debug and release.
I found that true until I stopped writing to the console. And even more so when I used profile guided optimization. At that point the C++ app embarrased the C# app. And in the same way C# cuts in half the time for VB.NET. The client decided not to look at Java knowing it didn't stand much chance.
C++
Total Time: 25.47ms
Per Tick: 0.00029ms // note that I had to extend this just to see the result!
Per 50K Ticks: 14.62ms
C#
Total Time: 185.10ms
Per Tick: 0.0021ms
Per 50K Ticks: 106.23ms
C++/CLI
Total Time: 174.00ms
Per Tick: 0.0020ms
Per 50K Ticks: 99.86ms
Native C++ still!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
-- modified at 23:09 Tuesday 23rd May, 2006
|
|
|
|
|
|
bob16972 wrote: Nish's numbers
It's a 4-year-ago article though. Maybe the numbers with VisualStudio 2005 may change.
Maxwell Chen
|
|
|
|
|
|
SaRath C wrote: http://msdn2.microsoft.com/en-us/library/bw65k95a.aspx[^]
Not getting your point... Would you be more specific please?!
Maxwell Chen
|
|
|
|
|
I'm not sure those numbers would tell anything about using C++ vs C# vs C++/CLI in a real world application using VS2005. What was done was to take a part of an algorithm that may or may not be used as part of a larger decision making application and benchmark using the various languages and VS2005. Optimizations that VS2005 provides played a big part in making the difference even wider. I don't think those were available when Nish did his tests.
You may want to take his tests and see where it goes with VS2005. I'm sold on C++ and VS2005 at this point!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Ed K wrote: I'm not sure those numbers would tell anything about using C++ vs C# vs C++/CLI in a real world
Ed K wrote: I'm sold on C++
I'm in total agreement with you. It seemed like you were in a benchmarking mood so I was just putting a road sign up to his article. I'm guessing most people are not as critical of the data they are fed and are willing to accept the results and the choice of the test parameters chosen by the authors. I prefer to be critical of everything I'm fed anymore but I lack the time and the talent to challenge his numbers as he seems to be the most knowledgeable person here concerning the CLI. I believe a little healthy debate or the possibility of a challenge helps keeps everything honest in the end and everyone benefits.
Take care.
|
|
|
|
|
i have a progressbar in my dialog and i have a manifest so it will use xp themes how do i get my progressbar to be smooth? and a different color would be good.
|
|
|
|
|
locoone wrote: i have a progressbar in my dialog and i have a manifest so it will use xp themes how do i get my progressbar to be smooth? and a different color would be good.
PBS_SMOOTH , PBM_SETBARCOLOR and PBM_SETBKCOLOR .
Resource editor has an option for changing from blocks to smooth. Check the styles tab.
PBM_SETBARCOLOR and PBM_SETBKCOLOR are the messages that you use to set the bar color and background color of a progress bar. Use SendMessage .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
i tryed them but my manifest is not letting them change.
|
|
|
|
|
See Here[^]
maybe it is some helpful to you
whitesky
|
|
|
|
|
look at the bottom of that link in the messages there is someone having the same trouble as me.
|
|
|
|
|
Hi,
I've dynamically created some CEditViews in a CScrollView. They look fine on the screen, but I'm not able to print them. According to the docs, CEditView is supposed to support printing. Is that only when it is the View in the Doc Template?
I've tried everything I can think of, short of drawing the strings myself, and can't make it work. I'd greatly appreciate any help.
Thanks!
Richard
|
|
|
|
|
When your view class is derived directly from CEditView, the Print feature works right out of the box. However, you dynamically created those views inside the client area of another view which means the turn-key print feature just ain't happening without, as you said, drawing the strings yourself in the parent view.
I can think of some ways to achieve this but it's way more trouble than it's worth. Coordinating the metrics between controls and windows is one of those things that looks simple but there are quite a few "gotcha's" like this. I spent years trying this and trying that but in the end, if your gonna use views and want controls on them, it's best to go windowless with the controls. This simplifies the things your going to want along the way, scaling, scrolling, printing, double buffering, etc...
|
|
|
|
|
If the client sent 10 bytes.
Then the server recv(socket,buf,20,0).
Is it possible that the client recv recveived less than 10 bytes?
|
|
|
|
|
Most definitely.
It's not a one send call, one receive call situation in networking. It's easy to test network code on a local network and have something that makes that assumption work but the minute you pass that through a router and such, your likely to realize that it gets all broken up and requires you keep posting recv commands until you account for every last byte.
Assume nothing in network programming
-- modified at 23:04 Tuesday 23rd May, 2006
|
|
|
|
|
hi I have posted this yesterday but nobody answered I have searched and added some stuff..maybe somebody know something about it..
Im writing a multithreaded program in borland c++ builder 6 that communicate with serial port..readFile function is on a seperate thread and its called ( the thread) by void __fastcall read_thrd::Execute() (which replace the thread function..)..so how can I write a function that reads the serial port automatically when there is something??..(how to get the serial port status(or whatever) and react to it?)
there are some functions like WaitForSingleObject ,SetCommMask and WaitCommEvent, but I dont know how to use them properly(where to use them? in the reading thread or the main thread?and which flag to use?)
Execute() could be controled by Resume() - will resume its execution- and Suspend() - will pause and suspend its execution- and those two functions are the way to communicate with the thread from the main thread -in addition to Terminate() - , so I can write my code in execute() or in other function and then call it.
now my code it as simple as this: (Im using a butten to call resume)
void __fastcall read_thrd::Execute()<br />
{<br />
FreeOnTerminate = true;<br />
while(!Terminated)<br />
{<br />
ReadFile(Form1->m_hCom, &(Form1->sBuffer), 128, &(Form1->iBytesWritten), &osReader) ;<br />
Suspend();<br />
}<br />
<br />
if(Terminated)<br />
{<br />
void __endthread(void);<br />
}<br />
}
I need to replace it ..so I dont have to click the butten to read the comm port..can you help??please?
|
|
|
|
|
I don't have a specific answer to your question, but there are several articles on CP that you might be able to adapt or learn from, such as:
http://www.codeproject.com/system/serial.asp[^]
Search for "serial" or "com port" in the search bar at the top of CP.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
The ReadFile call will attempt to read in as many bytes as you say you have room for. If that is 128, and you haven't received 128 bytes, it will continue to wait. If you want to receive a message anytime there is something in the recv buffer, use 1 byte or set the com mask to look for a certain character (e.g. one that you use for the end of a message). The COM port/Serial Port articles on here should be enough to get you started with that.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
the problem is that: Im using the serial port to operate GSM modem so I need my reading thread to notify me when I recieve SMS for example....and the articals here are using there own libreries..I need something standerd..
|
|
|
|
|
Hello everybody,I have just purchased Visual Studio 2005 and I have problem with the MessageBox funtion!!!
when I write for example MessageBoc("Hello") an error occurs:
cannot convert parameter 1 from 'const char [6]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
There is no problem with other functions like MessageBeep
why????
In Visual Studio 6 there is no such problem
please help
-- modified at 20:27 Tuesday 23rd May, 2006
|
|
|
|
|
I am sorry for the inconvenience but I figured out that the cause was the unicode libraries...
|
|
|
|
|
VC2005 defaults to UNICODE builds. Either turn off the UNICODE option, or use the TCHAR functions and macros
MessageBox(_T("Hello"));
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
MessageBox(_T("Hello"))
hi
|
|
|
|