[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Enumerating the ROT in VB using APIs      Help please !!

Asked by RAFAAJ in Visual Basic Programming

Tags: getrunningobjecttable, vb

I found this code on the web but it's witten in C. Can anyone translate this into VB please.


int _tmain(
    int argc,
    _TCHAR * argv[]
    )
{
    HRESULT hRes;
   
    hRes = OleInitialize(NULL);
    if (FAILED(hRes))
    {
        _tprintf("OleInitialize failed (0x%08X)\n", hRes);
        return -1;
    }

    IRunningObjectTable * pROT = NULL;
    IEnumMoniker * pEnum = NULL;
    IMoniker * pMoniker = NULL;
    IBindCtx * pBindCtx = NULL;
    PWSTR pszName = NULL;
    ULONG cElt;

    for (;;)
    {
        // get interface pointer of the running object table
        hRes = GetRunningObjectTable(NULL, &pROT);
        if (FAILED(hRes))
        {
            _tprintf("GetRunningObjectTable failed (0x%08X)\n", hRes);
            break;
        }

        // create binding context object
        hRes = CreateBindCtx(0, &pBindCtx);
        if (FAILED(hRes))
        {
            _tprintf("CreateBindCtx failed (0x%08X)\n", hRes);
            break;
        }

        // enumerate running objects
        hRes = pROT->EnumRunning(&pEnum);
        if (FAILED(hRes))
        {
            _tprintf("IRunningObjectTable::EnumRunning failed (0x%08X)\n",
                     hRes);
            break;
        }

        // go through all monikers in the table and display moniker name
        while (pEnum->Next(1, &pMoniker, &cElt) == S_OK)
        {
            hRes = pMoniker->GetDisplayName(pBindCtx, NULL, &pszName);
            if (FAILED(hRes))
            {
                _tprintf("IMoniker::GetDisplayName failed (0x%08X)\n", hRes);
                break;
            }

            _tprintf("%ls\n", pszName);

            CoTaskMemFree(pszName);
            pMoniker->Release();

            pszName = NULL;
            pMoniker = NULL;
        }

        break;
    }

    if (pszName != NULL)
        CoTaskMemFree(pszName);
    if (pMoniker != NULL)
        pMoniker->Release();
    if (pEnum != NULL)
        pEnum->Release();
    if (pBindCtx != NULL)
        pBindCtx->Release();
    if (pROT != NULL)
        pROT->Release();

    OleUninitialize();
    return 0;
}


I'll increase the points if I get a working VB example.

Thank you.

[+][-]10/09/06 04:11 PM, ID: 17694561Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Visual Basic Programming
Tags: getrunningobjecttable, vb
Sign Up Now!
Solution Provided By: Ark
Participating Experts: 4
Solution Grade: A
 
[+][-]10/04/06 04:24 AM, ID: 17658418Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 06:40 AM, ID: 17659260Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/04/06 07:17 AM, ID: 17659565Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 08:02 AM, ID: 17659895Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 08:07 AM, ID: 17659934Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/04/06 08:13 AM, ID: 17659990Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/04/06 08:21 AM, ID: 17660061Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 08:26 AM, ID: 17660104Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/04/06 08:31 AM, ID: 17660154Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 08:43 AM, ID: 17660270Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/04/06 12:18 PM, ID: 17662205Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 12:57 PM, ID: 17662673Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 01:23 PM, ID: 17663054Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 02:49 PM, ID: 17663841Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/06 05:05 PM, ID: 17664725Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/05/06 09:57 AM, ID: 17670299Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/06 01:17 AM, ID: 17689268Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/06 06:58 AM, ID: 17690601Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/10/06 06:49 AM, ID: 17698740Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/27/06 06:18 PM, ID: 18024741Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/28/06 05:30 AM, ID: 18027539Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/03/06 07:27 PM, ID: 18065990Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12/09/06 03:43 AM, ID: 18107311Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92