|
Ravi Bhavnani wrote:
Try #include <unistd.h>
Ah, now it works perfectly on unix using getcdw(...) . But the strange thing is, VS complains it couldn't find that.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Weiye Chen wrote:
But the strange thing is,
It's not strange - the UNIX manual states you need to include <unistd.h> while the Microsoft docs state you need to include <direct.h> .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hee, i am new to unix environment. :-> Anyway, thanks for the help.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
|
I'm creating a plugin for Enterprise Manager's Stored Procedure dialog box to enable it to have "Find Text" capability.
If you've seen this text box that contains the SQL Stored Procedure text, you'll know that it highlights certain key input text. So it's handling is slightly different than your average EditBox or RichTextBox control.
I have found that this "DimensionEdit" object (the name of that text box control class), does NOT respond to any EM_* windows messages (eg. EM_SETSEL). It does, however, respond to general WM_GETTEXT and WM_SETTEXT messages.
The funny thing is, it sort of acts like a RichTextBox control. When i'm in the Enterprise Manager program, I can select text in it and it will be highlighted correctly. BUT i want to be able to highlight text from an external application by passing windows messages.
This "DimensionEdit" object may have its own custom message handling. I've searched everywhere for what this object is and can't find any info on it. A clumsy way to do this would be to set the font of the 'found' text. But that is just a workaround.
So... if you can select the text manually in the program, then why can't i send a message to the control (via external app with SendMessage) to do the same??
Any ideas are GREATLY appreciated!
|
|
|
|
|
Anyone have any ideas?
|
|
|
|
|
For the InitializeCriticalSection LeaveCriticalSection, can more than one thread, at the same time, calling them on a same CRITICAL_SECTION structure?
If not, do I have to lock the InitializeCriticalSection and LeaveCriticalSection by using another CRITICAL_SECTION?
|
|
|
|
|
Interesting. One approach is to initialize the critical section to NULL. If you have pointers to the same raw object, then look for NULL.
Kuphryn
|
|
|
|
|
InitializeCriticalSection should be called only once by the process before the threads can use it. Those threads shouldn't call InitializeCriticalSection , but rather EnterCriticalSection or TryEnterCriticalSection in order to gain the ownership of the critical section (which may imply waiting for some other thread to release it). Once a thread obtained ownership of the critical section, and after using it, it should call LeaveCriticalSection to release it. No more than one thread will call LeaveCriticalSection at the same time, because only one thread can own the critical section at the same time (that's why they are using a critical section in the first place ).
More info can be found here[^] and here[^].
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
Hi,
I'm developing a namespace extension and it's going pretty well,
I've created my own shell folder and I use ShCreateFolderView to create the view.
Everything works fine, but when I try to doubleclick on one of the items, which I've given the browsable and folder flag, nothing happens!
Do I need to respond to some kind of notification for this to work? Or is there some interface I should use?
I've tried to use the IDataObject to hand back the pidl of the item, but didn't work,...
Thanks in advance...
"There is an empty room full of people who think you are creative"
|
|
|
|
|
I am trying to analyse this piece of C++ code below. It is an example code from qwt.sf.net which is an extension to QT graphics library.
I assume line 03 is calling a constructor? I have never seen it written this way. Is this a new syntax in C++? Same again in line 12. Are QApplication & QString constructors? While a & info are the references to the new constructed objects? And wtf is going on in line 14? Please can someone explain what is going on.... :S
[code]
01. int main(int argc, char **argv)
02. {
03. QApplication a(argc, argv);
04.
05. QVBox vBox;
06. vBox.setCaption("Cpu Plot");
07.
08. CpuPlot *plot = new CpuPlot(&vBox);
09. plot->setTitle("History");
10. plot->setMargin(5);
11.
12. QString info("Press the legend to en/disable a curve");
13.
14. (void)new QLabel(info, &vBox);
15. a.setMainWidget(&vBox);
16.
17. vBox.resize(500,300);
18. vBox.show();
19.
20. return a.exec();
21. }
[/code]
PS: If you are interested in seeing more, download qwt.sf.net
|
|
|
|
|
Line 14 is a call to the class's constructor. Just like Java yes?
Why couldn't line 01 do QApplication a = new QApplication(argc, argv); and line 12 do QString info = new QString("Press the legend to en/disable a curve"); ? Or are they just the same as line 14's way of creating an object?
|
|
|
|
|
kevingpo wrote:
Why couldn't line 01 do QApplication a = new QApplication(argc, argv);
Of course it could, but it is not the same thing.
I suggest you read some book on C++ before analyzing that code
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
kevingpo wrote:
I assume line 03 is calling a constructor
On line 03, object a is created on stack, initialized with argc and argv
kevingpo wrote:
Is this a new syntax in C++?
Nope, always been that way. You must be coming from Java or C# backgrond, right?
kevingpo wrote:
Are QApplication & QString constructors?
They are types.
kevingpo wrote:
And wtf is going on in line 14
That's a strange one indeed - an object of class QLabel is created on the heap, but without any pointer or reference to it. I wild-guess that vBox takes ownership of it, or you would have a memory leak otherwise.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
kevingpo wrote:
I assume line 03 is calling a constructor?
right
these two lines above are doing the same thing :
QApplication a(argc, argv);
QApplication a = QApplication(argc, argv);
the only difference is the first one is calling the constructor implicitely, when the second one doesn't. when a constructor is declared as explicit , you cannot call it with the first way...
kevingpo wrote:
Are QApplication & QString constructors?
in C++, the constructor must have the same name of its class.
so, all depends on what line of code you are looking at.
kevingpo wrote:
While a & info are the references to the new constructed objects?
sorry, here, i don't understand your question...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I need to convert a rtf (or doc) file to a PDF file because the meetting only accepts PDF file.
could you tell me how to covert it?
I only have Adobe read (not write), may I use it for my purpose?
thx
includeh10
|
|
|
|
|
You need the full version of Acrobat, instead of just the reader. It costs money.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
FYI, Sourceforge has PDFCreator[^] and does a very good job converting to PDF for any program that has the ability to print.
Steve
|
|
|
|
|
Try this open source program - PDFCreator[^]. It installs a "printer" that can be used by any program that has a print menu - but instead of going to a printer, it asks for the file to save the PDF output to. I recomend the version that uses AFPLGhostScript (instead of GPLGhostScript).
Steve
|
|
|
|
|
Hi,
This question probably has a simple answer, but for some reason I can't find it.
I'm still using Visual C++ 6.0. I'd like to get an autocomplete list of members when I'm working on a member function.
Let's say I'm writing
int MyClass::myMemberFunction()
{
int temp = m_ // I'd like to get a list of MyClass members to pop up here
}
I can get a list of members to pop up if I type 'this->' and hit ctrl-space, but that's too much work. I can go to class view, but even there I can't figure out how to copy a member from the list.
So, is there a nice simple way to get a list of the members of MyClass when I'm writing a member function?
Bruce
|
|
|
|
|
Odd. It's supposed to work within a class context.
Have you tried deleting the .ncb-file, thus forcing visual studio to regenerate the intellisense database?
Good music: In my rosary[^]
|
|
|
|
|
Hello,
Well I have use Visual studo C++ 6
and now I use *.net. And I need to do somethings
but I cant find where I do that.
In VS 6 I use ctrl+w and there I can add some WM_funk
but where it that now?
And I want to add my own ID_Funk like a ID_CLOCK value 1 or something but where do I do that now.
Is there anyone that can help me.
|
|
|
|
|
hiho@ll
i need a multimedia library, through which i get simply (very simply) control over a camcorder (i need: get the pixels of a stream), control some output window, which displays manipulated camcorder input (i need control over the pixels), control soundcard/microphone (get microphone stream, change it, forward it to loudspeaker)!
i know directshow, but for a beginner it's a bit heavy for that what i need
maybe there is somekind of wrapper for that, which is more easier to use
thx@ll
|
|
|
|
|
I strongly suspect that DirectShow would come with examples to do what you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|