|
Thanks guys, the info that ive recieved is going to help allot Im off to program a little more and ask questions a little less "I dont know if that'll ever happend though "
~There is an end, when you cant learn any more... isnt there?
Thanks Again!
~SilverShalkin
ps... To those whom this annoys,...
I see thee no more
Christian Graus wrote:
Anyone who gets annoyed that you're trying to learn something is best ignored, not apologised to.
right when you think you have
learned it all, there is always
somthing that'll come allong just
to annoy you. I guess thats why
programming could be considered as the
unsolvable puzzle
where you recieve a peice of the picture
ever so often but still have thousands
of peices left.
|
|
|
|
|
SilverShalkin wrote:
~There is an end, when you cant learn any more... isnt there?
IMO
Other than when your dead...nope...
Programming is like:
The more you know, you more you realize the less you know.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Other than when your dead...nope...
Hockey
I think what he meant is that once you get too old you cannot learn anything more, not that you reach a stage where there is nothing more to learn. I might be wrong though, in which case, your statement that till death, human beings can learn and learn and learn is correct
Nish
I am the Keyboard Smasher
|
|
|
|
|
Age doesn't have a bearing on anyones ability to learn I don't think.
Certainly some go crazy, but even crazy people probably learn...like OUCH better not smash my head into the wall like that again...
Everything/body learns until the end, then it's your guess against mine to what happens after that. Maybe it's like the Matrix and we come back and learn some more...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Programming is like:
The more you know, you more you realize the less you know.
Not Only programming Hockey,everything..everything.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I knew somebody was gonna jump on me for that.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I'm trying to programmatically create some virtual directories for a release process and I've run into a strange problem. If I create the virtual directory using the Internet Information Services control panel, the directory is fine and it has an icon of a box with a ball coming out of it. If I use the code shown below, it looks like it creates an application instead of a virtual directory like I think it should. The resulting icon is a folder with a little world on the right lower corner.
Can anyone see what I'm doing wrong with the code below?
Thanks in advance,
Craig
USES_CONVERSION;
try
{
HRESULT hr; // Generic COM result variable
_variant_t variant; // Variant used to set some properties in the metabase
IADsContainer* virtDirRoot; // Virtual root
IADs* virtDir; // The new virtual directory
IDispatch* pDisp = NULL;
//
// Get the virtual directory root
//
hr = ADsGetObject(L"IIS://Localhost/W3svc/1/ROOT",
IID_IADsContainer,
(void**) &virtDirRoot);
if(FAILED(hr))
{
return hr;
}
//
// Create the new virtual directory
//
_bstr_t virtPath("c:\\inetput\\wwwroot\\Test");
hr = virtDirRoot->Create(L"IIsWebVirtualDir", // Name of the virtual directory schema class
L"Test", &pDisp); // Relative name of the object to create
if(FAILED(hr))
{
IErrorInfoPtr error;
HRESULT hr;
CComBSTR description;
hr = GetErrorInfo(0, &error);
if (SUCCEEDED(hr) && error != NULL
&& SUCCEEDED(error->GetDescription(&description)))
{
//return description;
}
}
// Get the IADsContainer interface
hr = pDisp->QueryInterface(IID_IADs, (void**) &virtDir);
// Set the AspAllowOutOfProcess switch
variant = L"true";
virtDir->Put(METABASE_ALLOW_OUT_OF_PROC_COMPONENTS, variant);
virtDir->Put(L"AccessExecute", variant);
// Set the physical path
variant = physDirPath;
virtDir->Put(L"Path", variant);
//
// Set the info
//
virtDir->SetInfo();
return 0;
}
|
|
|
|
|
Using the MFC fn AfxBeginThread requires:
UINT MyFunc(LPVOID);
But using the API call CreateThread requires:
DWORD WINAPI MyFunc(LPVOID);
whats going on here?
|
|
|
|
|
AfxBeginThread calls internally CreateThread. But the address of your function isn't passed directly to Win32 API. In the middle there's also CWinThread object which accepts a function with slightly different header.
Just step into AfxBeginThread with the debugger and you'll see the details.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
hmm I checked the code. AfxBeginThread actually ends up calling _beginthreadex.
If I guess right, this is cos of the extensive C library calls MFC makes.
Someone please clarify this. sigh.
|
|
|
|
|
Satheesh wrote:
AfxBeginThread actually ends up calling _beginthreadex.
Make one step further. Step into _beginthreadex and you'll see the light (I mean, the CreateThread call). FYI, it'll be line 125 of THREADEX.C (on VC6 SP5).
MFC needs to prepare a environment for its thread. It's done via CWinThread object. And - since MFC is a C++ library, it needs to create threads with _beginthreadex to ensure that CRT works OK.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Too bad there aren't thread creation vectors you can set so that when a thread is created, the routine gets called automatically. Then MFC and CRT can install their own vectors and we could all call CreateThread.
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?
|
|
|
|
|
If you're a perverse enough process, you can probably launch yourself as a debugee and use WaitForDebugInfo.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
LOL...
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?
|
|
|
|
|
The whole point is that the two functions are prototyped different. If they were both DWORDS it'd have been easy. Now one is an UINT. Thus we cant use both AfxBeginThread and CreateThread on the same function without changing the prototype manually. After all most of us do a return 0
Nish
I am the Keyboard Smasher
|
|
|
|
|
The mess gets a little worse when you are trying to produce a add on library. If your add-on requires that MFC or CRT has been initialized in a thread, then you have to depend on the user invoking the right routine. IMHO, a perfect world would be one where I could do something and then the programmer would only have to call CreateThread and CRT is initialized for my via some back door method.
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?
|
|
|
|
|
think I am doing somthing wrong here. I cant find threadex.c even though I have SP5 installed. The debugger cant find it and I cant either!!Satheesh
|
|
|
|
|
Hi,
I have been loading images from memory directly into GDI+ Bitmap Objects. This involved creating a stream. Somebody recommended that I used CreateStreamOnHGlobal, which works great.
Now I am looking at doing the reverse, saving JPEG data represented by the Bitmap object into memory again through a stream and createstreamonhglobal. My question is how do i know how big I have to make the global alloc, do i just have to make sure it's sufficient or is there anyway of determining the size or making the size of the stream dynamic. Hope this is clear, any advice or comments would be grately appreciated.
Thanks Again
Rich
|
|
|
|
|
You do not have to worry about the size of the stream, it will automatically resize itself as space is needed.
There is no real way to determine how large a JPEG will be until you compress it as if you were going to save it to a file. So allocate a small memory buffer with CreateStreamOnHGLOBAL and then pass the stream object to Save in the bitmap, the memory will be taken care of for you.
If you do find a way to determine how mush space your image will take, you can use the SetSize method to reallocate memory in your stream.
|
|
|
|
|
When I'm using a DialogBar, with controls on it (particulartly Frames, and Buttons)..... do standard procdedures using a dialogBar in a Doc/View application, make a dialogresource, set an ID for the dialog bar, ID's for the controls...etc...
When I implement the code for the button in a dialogbar it works fine.. but when i implement code for a frame control(the message map in CLASSWIZARD is only BN_CLICKED), when i click on the frame when i run the program, it doesn't get executed...
How come when iclick on the button control in the dialogbar something gets executed, but when i click on the frame control, nothing gets executed?? is this a bug in Visual C??
|
|
|
|
|
AFAIK, buttons send messages to their parent window, not their owner. (when a dialog bar is not docked, it's parent is no longer the frame window; instead it is a child of a mini-frame created to float it)
You'll have derive a class CDialogBar and put the code to handle the button press in that. Then you can forward it on to your frame window if necessary.
And if words were wisdom, I'd be talking even more. The Offspring, I Choose
|
|
|
|
|
Actually the messges of my buttons in my Dialog Bars works fine...even if the dialog bar is docked or floating but the messges of the Frame Controls in the Dialog Bar doesn't....
How do I forward messages to my FrameWIndow??
|
|
|
|
|
Sorry, i'm misunderstanding you. Do you mean the controls on the frame, like the close or maximize buttons, or do you mean a STATIC control drawing an etched frame w/ in the dialog bar?
And if words were wisdom, I'd be talking even more. The Offspring, I Choose
|
|
|
|
|
I mean the Static Control drawing an etched frame within the dialog bar.... when you make a dialog resource, VS has toolbars that lets you draw any kinds of controls in the dialog resource.... The toolbar button that says picture control....
|
|
|
|
|
Ok, i understand now. These controls are usually not used for input, so i was confused. Anyway, make sure that SS_NOTIFY is set; you'll then get messages when the user clicks or double-clicks on the control. Not too much else you can do with a frame, really.
Sometimes I only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|