|
Hi,
Does any one know how to get a security descriptor from SID . I got the SID of a user using LookupAccontName API. I dont now how to get the security descriptor corresponding to the SID.
Thanks in advance
|
|
|
|
|
See Here[^] and this[^]site maybe it is some helpful to you
whitesky
|
|
|
|
|
What is the difference between Win32 applcation and Win32 Console application?
Because I did one simple addition function in Win32 application,it gave me a link error and it mention some error in WinMain()
-- modified at 0:53 Thursday 20th July, 2006
|
|
|
|
|
A console app runs in a console window, and the entry point is main() . A GUI app doesn't automatically get a console window, and the entry point is WinMain() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Win32 console is a text terminal window within the system of Windows API. A Win32 console has a screen buffer and an input buffer.
A Win32 application is a 32-bit application that meets Microsoft's Win32 API standard. This standard ensures that applications can take advantage of Windows features such as graphics, window management, memory management, file I/O, security, networking, and threading. Win32 applications run on one processor or multiple processors and on multiple hardware architectures.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
From your comment I got the impression that you tried to say that Win32 applications are more flexible than Win32 console applications, but that is not true.
Win32 console applications can be as flexible as Win32 applications. In fact, a Win32 console application is a Win32 application which allocates a console for printf to work right away. Also, the entry point is main() because it is assumed that you will be making normal C/C++ applications when the project type is Win32 console.
In every other respect, they are capable of the same functionalities and can have the same features. They both can include "windows.h" and use all Win32 API functions. This means you can use "CreateFile" instead of "fopen" in a Win32 console application, just like in a Win32 application.
Rilhas
|
|
|
|
|
Hello all,
I have created propertysheet in wizard mode and i want to change the caption of third Wizardpage(derived from CPropertyPage) after it popups. In dialog editor i set caption of that propertypage(Say "x"). I want to change it to(say"Y") for reusability.
Can anybody help me?
Regards;
Aj
|
|
|
|
|
|
i use vc++2005, mfc, xp professional sp2.when i debug in functions of a files,the cursor doesn't exactly piont to the excuted line, but it piont to the third line before the excuted line. however,in the other files, everything is normal. i cleaned the solution and rebuilded it, but it don't work yet. what shold i do to make it normal?
|
|
|
|
|
// .h file
class CAPI : public CWnd
{
public:
CString Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId);
}
// .cpp file function
CString CAPI::Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId)
{
//username = wwtest2;
//Password = RD9234;
//Userid = wwtest2;
CString result;
static BYTE parms[] =VTS_BSTR VTS_BSTR VTS_BSTR;
InvokeHelper(0x2, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,UserName, Password, UserId);
return result;
}
"God helps to whom who helps other"
|
|
|
|
|
priyanka s wrote:
// .h file
class CAPI : public CWnd
Buddy, there no way we can help you as this class is not By MS!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You created a function for login ok then...
whitesky
|
|
|
|
|
i have cereated the function for login...but i dont know how to write code for that???
I am using Active X controls in my project.And the Api has all the function for that which i have in my project as awrapper class.This Active X control is going to b bridge b/w client and server....
I am stuck in the point of coding..
I am new to programmimg.....Thanks
|
|
|
|
|
|
LOGIN TO ODL SERVER TO GET SESSION ID AND DATA FROM THAT
|
|
|
|
|
Given the path of the file, how to open it with code? just like you double click it.
Thank you very much!!!
|
|
|
|
|
Use ShellExecute with the "open" verb.
e.g.
ShellExecute(
NULL,
_T("open"),
_T("C:\\a.txt"),
NULL,
NULL,
SW_SHOWDEFAULT
);
You will need to #include <shellapi.h> and link to "shell32.lib".
Steve
|
|
|
|
|
thank you very much for your help.
|
|
|
|
|
|
Hi guys,
I was wondering, when I do a system-wide WriteProcessMemory Hook it manages to crash Explorer on windows XP. The Hook works the way it supposed to but when the hook is initiated it crashes explorer. Would anyone know the reason why it does that?
I'm using the SetWindowsHookEx to do the hook. It works on all my other export functions, but for some reason explorer crashes when I initiate this particular hook.
Any help is appreciated. Thanks,
Robbie
|
|
|
|
|
What do you mean a "WriteProcessMemory Hook"? I know about SetWindowsHookEx but you don't explain how WriteProcessMemory fits into the picture. If you use DLL injection using SetWindowsHookEx the hook DLL is in-process and so can access the prosess's memory directly without the need for WriteProcessMemory .
Steve
|
|
|
|
|
Solution:
Silly me. Originally I had intended to do this stuff in header files, which meant I had to use __declspec(selectany) with these declarations. But at one point, I moved them into the .cpp files, but forgot to remove the __declspec . That directive tells the compiler to keep one reference to the code for the entire link module. If no other code references it, the code is discarded. All I had to do was to remove the directive, and voila!
I have a rather awkward problem with the optimizer in the VS2k3 C++ compiler.
I'm using global objects to initialize a linked list, which I later pick up in the program.
It works sort of like this:
struct Entry {
Data data;
Entry* next;
};
extern Entry* g_head = 0;
...
struct OneOfMyGlobalObjects {
OneOfMyGlobalObjects() {
static Entry entry;
entry.data = ...;
entry.next = g_head;
g_head = &entry;
}
} g_OneOfMyGlobalObjects; As the g_OneOfMyGlobalObjects variable is never used anywhere in the application, the compiler optimizes it away. Obviously, I don't want that. I figured I could circumvent this by slapping an extern onto the variable, but that didn't help. I went as far as putting a __declspec(dllexport) on it - that did the trick. Although, I don't want to export these objects. It's not the end of the world if I do, but I like tidiness.
Also, I do not fancy the idea of turning off some global optimizer switch, as I like optimization (but just not in these specific instances).
So, is there any magical #pragma or __declspec available?
--
Based on a True StoryLast modified: den 19 juli 2006 18:21:40 --
|
|
|
|
|
Hi all,
I'm trying to invoke web services written in c# from a VC++ 7.1 app.
The function I'm invoking is quite simple.
<code>
[WebMethod]
public int Foo(int i)
{
return i + 1;
}
</code>
It works fine when I test the client in C#. I then tested in VC++. I added the web reference and SPROXY generate the header files for me. Here's is my client code in c++
<code>
...
if (SUCCEEDED(CoInitialize(NULL))))
{
TestServices::CTestServices ws;
int ret = 0;
HRESULT hr = ws.Foo(3, &ret);
CoUninitialize();
}
</code>
However ws.Foo() returns E_FAIL. I stepped in the generated code and it failed at BeginParse() function in atlsoap.h
<code>
virtual HRESULT BeginParse(IStream *pStream)
{
ATLASSERT( pStream != NULL );
CComVariant varStream;
varStream = static_cast<IUnknown*>(pStream);
HRESULT hr = m_spReader->parse(varStream); //it fails here
if (SUCCEEDED(hr))
{
if (m_refMap.GetCount() != 0)
{
hr = E_FAIL;
}
}
return hr;
}
</code>
And I see following error message in the output window
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: Action.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: MessageID.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: To.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: Security.
ATLSOAP: CSoapRootHandler::endElement -- invalid SOAP message format while processing headers.
Also, here is the xml result returned by the web service call
<?xml version="1.0" encoding="utf-8"?>
<int xmlns="http://www.blahblah.com/webservices/">4</int>
What am I missing? Thank you all in advance.
-- modified at 17:41 Wednesday 19th July, 2006
|
|
|
|
|
I'm getting the same error. Please let me know if you got the answer for this problem.
Thanks,
Kapil
|
|
|
|
|
I kind of hate imagelists.
I'm trying to draw transparent images (without masks) from a CImageList with the ILD_TRANSPARENT ILD_NORMAL parameter and obviously it does not work as intended, because the error is between the chair and the keyboard.
This is how I do it :
My bitmap ( IDR_MAINFRAME ) is a 256 colours bitmap with RGB( 192, 192, 192 ) as the background
colour; the dialog BG colour is RGB( 218, 222, 232 )
void CAboutDlg::OnPaint()
{
CPaintDC dc(this);
COLORREF cDialogBG = RGB( 218, 222, 232 );
CRect rect;
GetClientRect( rect );
CBrush brush;
brush.CreateSolidBrush( cDialogBG );
dc.FillRect( rect, &brush );
CBitmap bmp;
bmp.LoadBitmap(IDR_MAINFRAME );
CImageList imageList;
imageList.Create(16,15, ILC_COLOR8, 4, 1);
imageList.SetBkColor( CLR_NONE );
imageList.Add(&bmp, RGB( 192, 192, 192 ));
imageList.Draw( &dc, 0, CPoint( 10, 10 ), ILD_NORMAL );
}
I'm becoming clueless and a bit aggravated because it seems i'm doing all the basics rights, and this should work as advertised.
Thanks.
( modified because I screwed up my post )
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
-- modified at 20:39 Wednesday 19th July, 2006
|
|
|
|
|