microsoft.public.vc.language
  Home FAQ Contact Sign in
microsoft.public.vc.language only
 
Advanced search
September 2008
motuwethfrsasuw
1234567 36
891011121314 37
15161718192021 38
22232425262728 39
2930      40
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
microsoft.public.vc.language Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Linked Lists debugger question         


Author: Robby
Date: Sep 19, 2008 20:52

Hello,

I am experimenting a little with linked lists. I am using Microsoft Visual
C++ .NET the old one (frame works 1.1... 1998-2002) to test my C code.

Anyhow, I have entered the following:
=============================================
#include
#include
#include

#include "Main.h" //ACM152 HEADER FILE

struct list {
int value;
struct list *next;
};

int main(void)
{
struct list n1, n2;
Show full article (1.19Kb)
3 Comments
  SetLayeredWindowAttributes()?         


Author: Vincent Fatica
Date: Sep 19, 2008 10:49

The docs say: "once SetLayeredWindowAttributes has been called for a layered
window, subsequent UpdateLayeredWindow calls will fail until the layering style
bit is cleared and set again".

That seems pretty straightforward, but I find that I can freely make a layered
window (text with alpha, transparent background) "blink" with code like that
below and without explicitly touching the layering style bit.

case WM_TIMER :
if ( wParam == FLASH_TIMER )
{
if ( pOSD->bToggle )
SetLayeredWindowAttributes(hWnd, CR_BACK, 0,
LWA_COLORKEY | LWA_ALPHA);
else
SetLayeredWindowAttributes(hWnd, CR_BACK, pOSD->alpha,
LWA_COLORKEY | LWA_ALPHA);
pOSD->bToggle = !pOSD->bToggle;
}

Though I haven't checked the return value, SetLayeredWindowAttributes() does not
seem to be failing. So what, exactly, does the comment in the docs mean?
Show full article (0.87Kb)
2 Comments
  C Question (array items in an array of structures)         


Author: Robby
Date: Sep 19, 2008 09:34

Hello,

I don't know if I am saying this right but my problem involves accessing
items of an array element within an array of structures!!!!!!!!!!

Here's what I mean, and if I am saying this wrong I really would like to
know how we describe such coding... or if it is even possible to do! I have
done numerous researches on the net but it seems everyone calls this
differently and the samples I reviewd at are not exactly like mine!

Here is the code in its simplest form!
============================================
struct ddlbProp{
long CURR_ICON_NUM;
int SCREEN_CTRL[5];
} DDLB_PROP[] =
{
200, {55,0,0,0,0},
205, {0,0,0,0,0}
} ;
Show full article (1.21Kb)
4 Comments
  Strange struct definition         


Author: George
Date: Sep 19, 2008 06:58

Hello everyone,

This is what I found when reading atl/com internal implementation code (e.g.
ATLCOM.h), for example in the definition of VARIANT. I show similar code
segment below.

I think the purpose of such struct definition is, defining struct and a
variable of the type (in this sample type tFoo) altogether, any other
benefits of using such type of definition?

(I have such question is because I always use typdef to define a struct
type, and then using a separate statement to define a vraible of the type,
not merge type definition and variable definition together.)

[Code]
struct tFoo
{
int abc;
} Foo;

int main()
{
Foo;
Show full article (0.71Kb)
6 Comments
  Strange struct definition         


Author: George
Date: Sep 19, 2008 06:57

Hello everyone,

This is what I found when reading atl/com internal implementation code (e.g.
ATLCOM.h), for example in the definition of VARIANT. I show similar code
segment below.

I think the purpose of such struct definition is, defining struct and a
variable of the type (in this sample type tFoo) altogether, any other
benefits of using such type of definition?

(I have such question is because I always use typdef to define a struct
type, and then using a separate statement to define a vraible of the type,
not merge type definition and variable definition together.)

[Code]
struct tFoo
{
int abc;
} Foo;

int main()
{
Foo;
Show full article (0.71Kb)
2 Comments
  ERROR: cannot insert multiple commands into a prepared state         


Author: Shilpa Uttarwar
Date: Sep 19, 2008 06:01

Hi All,

Platform: Windows XP
Language Used: VC++
Database Technology: ADO
Back End: Postgres
Postgres Language: plpgsql

Problem Statement:
I am executing stored procedure through my vc++ code gives error but when
same is executed through postgres UI it compiled successfully.

My stored procedure is:

CREATE OR REPLACE FUNCTION abi_sp_getnewfiles(strserverid character varying,
nmaxcount integer, nfilestate integer)
RETURNS refcursor AS
$BODY$declare

DECLARE cur cursor for SELECT recno FROM inputtable WHERE FileState=0 for
update;
ref refcursor;
rownum integer;
ncount integer;
nrecno integer;
BEGIN
rownum :=0;
ncount := 0;
-- select files
open cur...
Show full article (1.83Kb)
no comments
  Security related problems using the Outlook object model         


Author: Frank S
Date: Sep 18, 2008 14:27

I use this code excerpt to initialize the Outlook object model in my application:

HRESULT hr = NULL;
_ApplicationPtr m_pApplication;

hr = m_pApplication.CreateInstance( TEXT("Outlook.Application") );

This works fine normally, when both Outlook and the application are run in the same "security context".

However, errors result if:

1. Outlook is run with admin privileges and my application is not, or
2. Outlook is run with high integrity under Vista and my application is run with normal integrity.

How can I detect this type of problem so that I can give the user a clear error message about the
problem?

Thanks,

Frank
3 Comments
  WinInet issue         


Author: George
Date: Sep 18, 2008 07:19

Hello everyone,

I want to implement the shake hands of Windows Integrated Authentication for
myself. Here is a reference link of the protocol and steps of shakehands.

http://en.wikipedia.org/wiki/NTLM

I have tried a prototype using WinInet API below, and find each time when
using WinInet API InternetOpenUrl, this API will handle all underlying
authentication shakehands for me. :wave:

http://TestMachine/Monitor is a web site setup by IIS with Windows
Integrated Authentication, and the following invocation of InternetOpenUrl
will automatically returns 200 OK and will use my current login user's
credential automatically -- no change for me to parse return each time from
IIS and do the shakehands by myself.

My question is, could I use WinInet level API like InternetOpenUrl to
achieve my goal? Why?

My simple code.
Show full article (1.59Kb)
2 Comments
  Why dynamic_cast/static_cast?         


Author: Kürþat
Date: Sep 18, 2008 03:56

Hi,

What are the differences between simple C-style type casts and C++-style
dynamic/static casts? Why would one write "dynamic_cast (ptr)"
while he or she can simply write "(Foo * ) ptr"?

Thanks in advance.
7 Comments
  POS Printer         


Author: vvf
Date: Sep 18, 2008 03:02

Hi All,

I thought it would be easy to print to a simple POS Printer (Star SP 200,
parallel port) but for some reason it seems really difficult for me. I think
I have all the theory right, but I just can't print correctly text to it.

Here is what I know and what I think is right.

1) I know that in theory, all I have to do is send down to the printer plain
text and some control codes in order to access special features of the
printer (alignment, underlining, etc.) These special codes are non-printable
characters (escape codes.)

2) I am not using the Windows drivers because I know they strip non
printable characters so I am using the "Generic Text Printer" driver which
is supposed to not strip those characters. Is that correct?

3) I simply do the following:

hPort = CreateFile( _T("\\\\.\\LPT1"), GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, NULL);

Then, I do a WriteFile(hPort, strContents, iSize, &lpWritten, NULL),

where strContents is a CString containing my string to be sent to the
printer and iSize is (strContents.GetLength() )
Show full article (3.10Kb)
1 Comment
1 2 3 4 5 6 7 8 9