Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:23:29+00:00 2026-05-22T21:23:29+00:00

I have a Visual Studio 2008 C++ project for Windows Mobile 6 ARMV4I using

  • 0

I have a Visual Studio 2008 C++ project for Windows Mobile 6 ARMV4I using Microsoft SQLCE 3.5. When I initialize the VARIANT component of a DBPROP structure (as below), I get a compiler warning message: C4366: The result of the unary ‘&’ operator may be unaligned.

#include <sqlce_oledb.h>

DBPROP prop = { 0 };
::VariantInit( &prop.vValue ); // warning here

I can add __unaligned casts to the line, but because VariantInit doesn’t take an __unaligned, I get another C4090 warning.

I notice that the DBPROP definition in *sqlce_oledb.h* includes packing directives for MIPS architecture:

#if defined(MIPSII_FP) || defined(MIPSIV) || defined(MIPSIV_FP)
#pragma pack(push,8)
#endif
typedef struct  tagDBPROP
    {
    DBPROPID dwPropertyID;
    DBPROPOPTIONS dwOptions;
    DBPROPSTATUS dwStatus;
    DBID colid;
    VARIANT vValue;
    }   DBPROP;
#if defined(MIPSII_FP) || defined(MIPSIV) || defined(MIPSIV_FP)
#pragma pack(pop)
#endif

So, I can make the warning go away by doing something like this:

#define MIPSIV
#include <sqlce_oledb.h>
#undef MIPSIV

But, that feels dirty. My question is: Did the designers just overlook ARM in their packing directives (meaning I should do the dirty and claim to be a MIPS processor)? Or, should I just silence the warning and ignore it? Or, is there something else I should do?

Thanks,
PaulH

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:23:29+00:00Added an answer on May 22, 2026 at 9:23 pm

    If you plan to pass the DBPROP structure to other APIs, do NOT change its alignment, since that can change the packing and it will stop working. I notice the following comment in the header:

    #if 0 
    //DBPROPINFO is an unaligned structure. MIDL workaround. 42212352
    typedef DBPROPINFO  *PDBPROPINFO;
    #else
    typedef DBPROPINFO UNALIGNED  * PDBPROPINFO;      //????????????
    #endif
    

    So it seems someone was aware of a similar problem but did not change the packing, probably to avoid breaking existing code. I don’t see the rest of your code from here, but you could try one of the following:

    1. VARIANT tmp; ::VariantInit(&tmp); prop.vValue = tmp;

    2. prop.vValue.vt = VT_EMPTY;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Visual Studio 2008 Windows Mobile 6.5.3 ARMV4I project. I check for
I have a Windows Mobile/Pocket PC project in Visual Studio 2008 SP1. I have
I have a Visual Studio 2008 C++ Windows Mobile 6.5 project where I would
I have a Visual Studio 2008 C++ project for Windows Mobile 6 with two
I have a Windows Forms project in Visual Studio 2008, which references a library
I have a Visual Studio 2008 C++ project that has support for using multiple
I have created a setup project using Visual Studio 2008. After the application is
I have a Visual Studio 2008 C# .NET 3.5 project using MySql 5.1.53 and
I have a Windows Service project in Visual Studio 2008. I've also added the
I have a basic ASP.Net project created in Visual Studio 2008 on Windows Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.