|
Thanks a lot for your help!
Yep, i was after something along these lines:
typedef enum
{
Blue,
Red,
Yellow,
green[9]
};
ok, now i know that i need and int in front of green[9].
that helps a lot!
will try this tonight!!!
many thanks, Dominik
|
|
|
|
|
ahhh,
no, i just see that this is not possile.
however, using struct or a class will
be a bit unconvenient since it doesn't number the variables automatically.
i just like....
typedef enum
{
Blue,
Red,
Yellow,
Green[9]
};
anything else messes up the code i believe, Dominik
no one's got an idea????
thanks, Dominik
|
|
|
|
|
Hi,
I am using ADSI api and want to extract Net BIOS name from DNS using C++.
I got following sample from MSDN. But this sample is not compiling. I got following compilation error:
error C2065: 'IADsNameTranslate' : undeclared identifier
I have Included "activeds.h" and "Iads.h" in the header files but still I am not able to get the desired result.
The requirement is to extract NetBIOS name using DNS.
If someone has worked on it then please sent me the working code.
#include "activeds.h"
#include "Iads.h"
int wmain( int argc, wchar_t *argv[] )
{
IADsNameTranslate *pNto;
HRESULT hr;
hr = CoCreateInstance(CLSID_NameTranslate,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADsNameTranslate,
(void**)&pNto);
if(FAILED(hr)) { exit 1;}
hr = pNto->InitEx(ADS_NAME_INITTYPE_SERVER,
CComBSTR("aDsServer"),
CComBSTR("aUser"),
CComBSTR("userDomain"),
CComBSTR("passwd"));
if (FAILED(hr)) { exit 1;}
hr =pNto->Set(ADS_NAME_TYPE_1779,
CComBSTR("cn=jeffsmith,cn=users,dc=Fabrikam,dc=com"));
if(FAILED(hr)) {exit 1;}
BSTR bstr;
hr = pNto->Get(ADS_NAME_TYPE_NT4, &bstr);
printf("Translation: %S\n", bstr);
SysFreeString(bstr);
pNto->Release();
}
Regards... Ankur
|
|
|
|
|
Check the content of Iads.h and look if IADsNameTranslate is there or not. You may need to install/upgrade the Platform SDK.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi
In my VS6.0/C++ - Project, i am using CFormViews with Stingray-Grids. I have to Printout these Grids automatically each Hour (time-Triggered) on .pdf-Files (Pdf-Writer is installed) in Background. No CPrintDialog/CFileDialog should be shown on Screen.
(Because there is a Printout to a File, the CPrintDialog and CFileDialog will shown)
I created an own ::OnFilePrint (copy from VIEWPRNT.cpp) and made some changes. Especially, the FileName will created and set in the DOCINFO - Structure.
If i do that, the Files will printed (saved as .pdf-File) in Background.
The Point is now, that everytime a second file will created without an Extension and with FileSize = 0; Both Files (the correct .pdf and the incorrect File) will created in StartDoc.
If the CView::OnFilePrint will called instead of my own ::OnFilePrint, only a .pdf-File will generated, but i can't hide the CFileDialog. Where do I set the DOCINFO - Structure in this case ?
Is there a way, to use CView::OnFilePrint without show CPrintDialog/CFileDialog ?
Thanks for Help
|
|
|
|
|
In the following code the try-catch is being removed in a Release Build, which obviously is causing me some grief. I've done a quick Google but found nothing yet.
bool has_eos_terminator() const
{
try
{
return ( *(((TCHAR*)_mmaddr) + _mfsize) == 0
|| ( _mfsize > 0 && *(((TCHAR*)_mmaddr) + _mfsize - 1) == 0 )
);
}
catch( ... )
{
return false;
}
}
Any ideas?
I can re-write the code easily enough but I'd really like to know why the try-catch is gone. BTW I looked at the Assembler code in the Debugger.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Maybe the compiler thinks that no exeption will be thrown from your code and therefore removes the seemingly redundant code. What happens if you turn all optimizations off?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
Maybe the compiler thinks that no exeption will be thrown from your code and therefore removes the seemingly redundant code. What happens if you turn all optimizations off?
A Debug Build works as expected so I have to assume that turning optimizations off will resolve the problem. I would have thought that the optimizer shouldn't touch try-catch code, but then if it is working at the assembler level it probably doesn't know. That said this just seems like a real trap waiting to open.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
That is/was a known problem in VC6.
http://support.microsoft.com/default.aspx?scid=kb;en-us;247203
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
That is/was a known problem in VC6.
http://support.microsoft.com/default.aspx?scid=kb;en-us;247203
Thanks Tim, You've nailed it. I would like to assume this can only happen when the try block only contains fairly trivial code. My worry is testing every try-catch block in a Release build. I certainly don't want to turn off optimizations for all of these functions.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Is there any available components like addons for Visual Studio, which facilitate interface programming tasks. As it is easy under Builder C++ just attach context menu component to form and automaticaly coding its items by a single mouse click and the other similar components. While in VC++ getting CDocument/CView interface and manualy adding context menu instance to class and boring initialization it and the like.
9ine
|
|
|
|
|
hi ,
i'm presently in a project where i want to use windows password for my users authentication. I don't know how.
Could any one please provide me the resources.
Thanx,
Seenivasan Palaniappan
Long Live
|
|
|
|
|
What do you mean by 'use windows password' ? If you want just something that let the user enter a password in an edit box (and hiding the characters), you have an option with the editbox that let you do that (check the password option).
|
|
|
|
|
I think that he want's to use the users and groups from a windows domain controller for automatic authentication.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Well maybe you can accept user login details and do an impersonate login, if it succeeds then consider that it is a valid user.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Hi ,
I didn't get your question. But i assume that you want to check if the user is really a windows user and has entered his username and password correctly. If that is the case, then you can use concepts from http://win32.mvps.org
Also, refer to the "Authorization Functions" under the Win32 SDK help.
CreateProcessAsUser and CreateProcessWithLogon can be used.
Happy coding.
Regards,
Suresh Ponnusami
|
|
|
|
|
hi all..I am making a dialog based application and I want to make the windows size is in maximize size by default and I also want the windows can redraw itself when I resize the windows and play with the scroll, but I don't know hoe to...pls help
|
|
|
|
|
Write this in OnInitDialog to show it as maximized.
this->ShowWindow(SW_MAXIMIZE);
To handle redrawing functionality you will have to write your code in OnPaint.
Einstein: "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
My Articles
|
|
|
|
|
thx...btw where I can get some examples of redrawing functionality, because I am a newbie...
thx..
|
|
|
|
|
Hi all
I want to know some system information like Sound Card, Video card, Network Card and Peripherals like Printers,infrared, Scanners etc.
Thanks and Regards
|
|
|
|
|
Maybe this API's EnumDevices / EnumPrinters might help.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
You can retrieve such information from REGEDIT , using CRegKey class.
I do not exactly remember where they are stored but if you search in google it will definitely help you.
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
|
Reference the following code in C++ using Registry API methods
HKEY hKey;
DWORD n, RtnCode, RtnCode1;
char valName[256];
DWORD valNameBuf = 256;
char valData[256];
DWORD valDataBuf = 256;
bool bMatch=false;
for(n = 0, RtnCode = ERROR_SUCCESS; n
|
|
|
|
|
memset is what you need. As in memset(&valData[0], 0, 256);. You should also fix the rest of your code, unless you're actually programming in C. Putting all the variables at the top makes your code harder to read, and creating any variables without giving them default values is a recipe for bugs due to uninitialised values.
Also, your code is not displaying properly because you didn't check 'Do not treat <'s as HTML tags'.
Christian Graus - Microsoft MVP - C++
|
|
|
|