all groups > visual c > october 2007
Filter by week: 1 2 3 4 5
Managed and Unmanaged
Posted by Creativ at 10/31/2007 9:38:46 PM
I'm still confused with managed and unmanaged
In VS2005, in the same project with /CLR switch on.
in managed.h
ref class ManagedClass
{
}
in unmanaged.h
class UnmanagedClass
{
}
in Main.cpp
{
ManagedClass^ mc = gcnew ManagedClass; // So this is managed
UnmanagedClass umc... more >>
Problems with Manifest generation
Posted by Havatcha at 10/31/2007 3:37:43 PM
I have recently ported a project from VS .Net to VS 2005 and when I
build/run it I get a run-time error "R6034".
After a bit of poking around I discovered that my manifest file only
contains the following
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-m... more >>
VC++ 2005 problem creating an ActiveX in a secondary Thread
Posted by Daniele Piccinini at 10/31/2007 12:00:00 AM
Hi all,
In my vc++ 2005 dialog based application i need to use a comunication
activex component in a secondary thread:
CFINSAxEFS* pNewAx = new CFINSAxEFS();
if ( !pNewAx->Create( NULL, NULL, CRect( 0,0,0,0), pParent,
pNode->m_nFinsID) )
throw FALSE;
If i use this code in the ... more >>
delete []
Posted by George at 10/30/2007 12:04:00 AM
Hello everyone,
I remembered delete[] is implemented through operator overloading, but I am
not quite clear.
Could anyone recommend some links about how delete[] is implemented so that
I can learn and refresh my memory? :-)
thanks in advance,
George... more >>
DllUnregisterServer
Posted by George at 10/29/2007 11:49:01 PM
Hello everyone,
I asked a related question about when DllRegisterServer is called and my
question is answered. Now I am thinking that when DllUnregisterServer will be
called?
It is reasonable to understand that during installation process or when we
set Register Output to Yes in Visual... more >>
How are we supposed to remote debug our mixed application?
Posted by BWB at 10/29/2007 9:42:00 AM
We have a mixed application that includes managed and unmanaged code. Until
recently we've been able to remote debug by disabling the security policy to
get the MFC managed dlls to load properly over the network. However, we are
now using classes in the system.data.dll assembly which accor... more >>
about time and time_t
Posted by George at 10/29/2007 1:26:00 AM
Hello everyone,
In MSDN for time function,
time_t time(
time_t *timer
);
http://msdn2.microsoft.com/en-us/library/1f4c8f33(VS.80).aspx
the return value of time is time_t, but in the Return Value section, it
mentioned,
Return the time as seconds elapsed since midnight, Januar... more >>
DllRegisterServer
Posted by George at 10/29/2007 1:07:00 AM
Hello everyone,
I am wondering when function DllRegisterServer will be invoked? I am using
Visual Studio 2005 to develop an in-process native (unmanaged) C++ COM. I am
wondering when it will be invoked?
1. During the build process or during the DLL initialization process?
2. I find this... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
ATL project with Win32 DLL exported functions
Posted by Anonymous at 10/29/2007 12:00:00 AM
Is it possible to have an ATL project that also contains win32 exported
classes and functions?.
I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I
have been adviced that to export the ATL COM object,... more >>
Memory leak using omp parallel for within a thread
Posted by Hannes Steinke at 10/29/2007 12:00:00 AM
Hello,
I'm trying to use the command "#pragma omp parallel for" within a thread but
each thread that is created (and stopped again) produces a memory leak of
about 44kB.
If the entry for "Stack Reserver Size" in
Properties->ConfigurationsProperties->Linker->System is increased, the memo... more >>
Porting from unmanaged to managed
Posted by Dipesh_Sharma at 10/28/2007 11:41:01 PM
Hi all,
I have a Dll code written in VC++ having lots of structures, classes etc and
exporting 100s of APIs.
I have to port it to VC.Net to make it managed. How can i port the whole
code to make it managed. I have heard of IJW & wrapper. But please guide me
how can i migrate to VC.Net.
Th... more >>
changing a project from Win32 DLL to an ATL DLL (i.e. containing a simple ATL object)
Posted by Anonymous at 10/28/2007 2:15:57 PM
I have a Win32 DLL project that needs to be refactored to support ATL.
Specifically, I need to expose one COM object, that makes use of the
library functionality.
I tried adding a 'Simple ATL object' class directly to the project - but
that (unsuprisingly), failed. I then changed the projec... more >>
ScrollBar colors
Posted by Peter Oliphant at 10/27/2007 11:25:02 PM
Although the ScrollBar class has BackColor and ForeColor properties, these
properties don't seem to have any effect.
Is this correct? If so, is it possible to change the color of a ScrollBar?
[==Peter==]
... more >>
Commercial target screen resolution
Posted by Peter Oliphant at 10/27/2007 2:58:57 PM
In today's market, what's a good screen resolution that I can pretty much
count on as being the minimum?
This is kind of a 'fuzzy' question in that I'm interested in the biggest
screen resolution that I can be pretty sure most people who buy a computer
today (within the last year or two) wi... more >>
"This OS is not supported"
Posted by maelbe at 10/27/2007 2:18:00 AM
For the last few days, 5 to be exact, I have received a popup window when I
have turned on my computer. The message in the popup says "This OS is not
supported." I got a virus via MSN about a week ago, but successfully removed
it with the help of a friend (we used programs such as Hijackthis, ... more >>
Why does this code work?
Posted by xmail123 NO[at]SPAM yahoo.com at 10/26/2007 3:09:19 PM
I am new to C# and have been studying this piece of code. It loops
through an Adjacency Matrix table to populate a tree view. I have two
questions about why this code works.
1. initTreeView(TreeNode N) creates a new "temp" table to hold
the children for each node. Each time the table is c... more >>
how to monitor exe and dll interactions?
Posted by George at 10/26/2007 2:29:01 AM
Hello everyone,
Are there any tool or other methods which could be used to monitor which
class/method exe is accessing a DLL?
Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes and I suspect the 3rd party
application is i... more >>
Generate tlh/tli from a tlb?
Posted by Skirmish at 10/26/2007 12:33:33 AM
Long story short: I've been able to load a C# dll in C++ by having the
C# project generating a type library (tlb) and #importing that in C+
+. The #import directive looks like a compiler shortcut that
generates a tlh and tli locally. Now what I want to be able to do is
generate the tlh and tli... more >>
Expiry date for microsoft support on vc++?
Posted by Rajeshaz09 at 10/25/2007 8:32:01 PM
I heared that microsoft give technical support to vb upto this year end. Can
any one microsoft stops techinical support for vc++(6.0)? was microsoft
announced any official date?... more >>
How to statically linking 2 files for 32 bit and 64 bit in VC++ 2005
Posted by pranab.salian NO[at]SPAM gmail.com at 10/25/2007 3:07:36 PM
I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
MFC app in order to use a .sys file.
I have two xyz.lib files, one for win32 and one for amd64.
I know I should add the .lib file to ['Property Pages' > 'Linker' >
'Input' > 'Additional Dependencies']
But which file do I... more >>
Possible Bug: name of directory inhibits execution?
Posted by Peter Oliphant at 10/25/2007 9:08:25 AM
I have written a program using MS VS VC++ 2005 Express, /cli pure. Upon
compiling it it works fine in the GUI development environment. It also works
fine as a Debug stand-alone. ut I had an odd behavior when it comes to the
Release varsion when I renamed its project directory name it was in!
... more >>
nullptr for VS2005 but what about VS2003?
Posted by Charlie at 10/24/2007 7:43:00 PM
Hi guys,
I'm using delegates to execute a group of methods using the BeginInvoke,
that works fine; I'm waiting for the asynch thread to return the response
using the EndInvoke, that works fine also. The point is, I didn't find the
way to pass a null value to the BeginInvoke method for the As... more >>
Placing a Form on a particular Screen
Posted by Peter Oliphant at 10/24/2007 6:44:41 PM
I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode.
I've found the Screen class. With it I can very easily get the count and all
the data on the various Screens attached to a system, whether it be a single
screen or multiple screen system.
I believe the FromControl me... more >>
vcproj translated into Makefile
Posted by Ed at 10/24/2007 4:40:30 AM
Hello, guys,
Here I have a VC project. I used to build it in VS.Net IDE. But
because of cross platform requiremment, it need to be ported into
Linux.
First I need to consider the build environment. I need a tool to
translate the vcproj or solution file into some other common build
file, suc... more >>
Printf %d and %ld
Posted by George at 10/24/2007 2:17:00 AM
Hello everyone,
I think printf %d works fine with signed, unsigned and negative integer
values, and the same as %ld for long. Is that correct? If not, do we need to
special conversion?
thanks in advance,
George... more >>
Assemblies in VS 2005
Posted by rk at 10/23/2007 8:09:22 PM
I'm confused about C++/CLI assemblies in Visual Studio 2005.
I want to create a C++/CLI assembly in Visual Studio 2005. I know, that
I can get one by using the command line compiler. I don't know, how to
get one with the VS2005 IDE:
- Is a library created by File|New|Project|CLR|Class Libr... more >>
arrays
Posted by xontrn NO[at]SPAM yahoo.com at 10/23/2007 2:38:25 PM
Hello,
I am building a .net control in C++/CLI, and it will be hosted by a C#
form. The form will load some data from file and pass it to the
control (an array of bytes):
byte[] data = new byte[length];
.... // load the data from file
mMyControl.Load(data, length); // pass data into t... more >>
Form size differs in different OS's?
Posted by Peter Oliphant at 10/23/2007 7:46:17 AM
I'm developing a program at home on a Windows Vista computer. In it I create
a form with a few buttons on it that fill up the form's visible area.
So, I took the application to work, where I use a Windows XP PRO computer.
When I ran my program, the form visible area is different! Not very muc... more >>
Launching one CWinFormsDialog from another
Posted by James at 10/23/2007 4:49:02 AM
What I'm basically trying to do is show one form from another when an event
occurs.
This is obviously straightforward in c#, but I'm struggling in c++ where
each is wrapped in a CWinFormsDialog.
The event is in the control in the CWinFormsDialog. I need the dialog to
handle it and show the o... more >>
fatal error C1001: An internal error has occurred in the compiler
Posted by Anonymous at 10/23/2007 2:50:21 AM
My code has suddenly stopped compiling after some refactoring I carried
out last week. I am using VC8 on W2K professional
I get the following cryptic error:
Error 77 fatal error C1001: An internal error has occurred in the
compiler. c:\program files\microsoft visual studio 8\vc\include... more >>
message localization
Posted by George at 10/23/2007 2:39:02 AM
Hello everyone,
I want to print out and log localized message according to current locale of
machine. For example, if I am always use MESSAGE_ERROR macro in my program,
and I want to replace it with "Error" when the locale is en_US and be
replaced with French if the locale if Fr.
I am ... more >>
Need some advice!
Posted by Robert at 10/22/2007 11:45:01 PM
Hello,
Okay, after a few searches on Google such as, "what is .NET" and "what is
C#" I am now starting to see what all this means...
C++ is a language, and so is C#. You can get these languages in Visual
Studio. We can somehow program in C# and when we require the power of C++, we
can c... more >>
DLL property
Posted by George at 10/22/2007 10:48:01 PM
Hello everyone,
I am wondering how to set DLL property (when we select the DLL and using
right click to choose properties), like version, language, company, etc.?
Do we need to write some code or just need to configure something in Visual
Studio 2005?
thanks in advance,
George... more >>
Simple question!
Posted by Robert at 10/22/2007 9:23:01 PM
What is the diffrence between C++, C#, VC++ and .NET?
And what is this CLR that everyone is talking about?
So if I want to use the .NET frameworks, do I have to learn C#.
And how does Visual studio tie into all this?
And can C# do every thing that I used to do in VC++?
And where can ... more >>
.NET Framework versions
Posted by Peter Oliphant at 10/22/2007 8:34:07 AM
If I tell the compiler to target .NET Framework 3.0 (one of the References
options in VC++ 2008 Express), does it still work if they only have a higher
version (say 3.5) of .NET Framework installed? Or does it look for and only
work with the specific version? The various various versions (e.g.... more >>
How to update 'Edit Control' text from Timer Callback.
Posted by IdleBrain at 10/22/2007 8:17:26 AM
Hi,
I need a way to update an Edit control control in MFC from a timer
callback function.
How can that be done as we cannot reference dialog box controls from
callbacks?
Even the following code gives me problems:
VOID CALLBACK TimerProc ( HWND hParent, UINT uMsg, UINT uEventID,
DWORD dwTi... more >>
The various levels of /CLI
Posted by Peter Oliphant at 10/22/2007 8:13:40 AM
My program works great in 'vanilla' /CLI, so I tried both '/CLI pure' and
/CLI 'safe'. My program continues to compile and run fine in 'CLI pure' (I
also use error level 4 and don't even get warning errors), but generates
almost 400 compile time errors in '/CLI safe'.
So, more out of curio... more >>
virtual inheritance
Posted by George at 10/22/2007 5:49:01 AM
Hello everyone,
I have learned public/private/protected inheritance, but what is virtual
inheritance? Here is the sample,
class Usable : public virtual Usable_lock
http://www.research.att.com/~bs/bs_faq2.html#no-derivation
thanks in advance,
George... more >>
assert
Posted by George at 10/22/2007 1:40:04 AM
Hello everyone,
I saw a couple of form of assert in code on Windows,
1. ASSERT;
2. assert;
3. _ASSERT;
4. _assert.
Which one is the most correct to use? I saw people always define this to
that, and I want to find the root one which is defined by Windows.
I also saw people manually... more >>
Vista vs XP
Posted by Alex at 10/21/2007 10:14:00 PM
Hi All,
What are the major features/advantages in vista over xp?
Any links are available by microsoft?
--
Thanks & Regards,
Alex.
... more >>
stl vector
Posted by Alex at 10/21/2007 9:28:04 PM
Hi all,
I am devloping an application in VC++ with Visual Studio 2005. In this
applicatin, Threadpool and stl classes are there. All threads will
use(sending by pointer to vector) stl vector simultaneously for reading and
writing purpose. Sometimes, application getting crash. I think, v... more >>
derived class can not access base class protected member?
Posted by George at 10/21/2007 8:45:00 AM
Hello everyone,
I met with a strange issue that derived class function can not access base
class's protected member. Do you know why?
Here is the error message and code.
[Code]
error C2248: 'base::~base' : cannot access protected member declared in
class 'base'
[/Code]
[Code]
cl... more >>
trim heading and trailing space
Posted by George at 10/21/2007 12:56:01 AM
Hello everyone,
I think in built-in C/C++ functions, there is no direct function call to
trim heading and trailing space characters, right? So, we have to implement
it manually by iterating the string to check character one by one.
Support not using MFC.
thanks in advance,
George... more >>
Which image file formats does Image/Bitmap support?
Posted by Peter Oliphant at 10/20/2007 7:29:17 PM
The Image class allows loading a bitmap from a graphic file. So far I've
gotten it to work with JPG and BMP files.
What other graphic file formats are supported in this way? Is this fixed
based on the .NET Framework used (e.g., the Image class defines which
formats can be used), or can diff... more >>
pin_ptr of delegate that spans scope of function
Posted by john conwell at 10/19/2007 11:27:01 AM
I have a C++/CLI library and I'm calling a function, RegisterTraceGuids()
that takes a function callback as a parm. I need the callback function to be
a managed delegate. In order to do this I create a pin_ptr of the delegate
and then pass it to RegisterTraceGuids.
The problem is that pin_... more >>
countdown clock
Posted by Mike at 10/19/2007 10:02:09 AM
I want to create a clock that will countdown the number of days left to =
a certain event. I want it to show, days, hours, minutes and seconds. If =
possible I woud like to make it a floating form or if possible to show =
in the task bar, is this possible to do and were could I find something =
... more >>
delete this
Posted by George at 10/19/2007 12:19:09 AM
Hello everyone,
Just interested to learn how C++ implements delete this statement
internally. From logical point of view, I can not imagine how to implement a
component which destroy itself.
What makes me confused is the component is relying on itself even in the
process of destroy, ho... more >>
DllMain
Posted by George at 10/19/2007 12:01:39 AM
Hello everyone,
From MSDN,
http://msdn2.microsoft.com/en-us/library/ms682583.aspx
parameter fdwReason of DllMain has four values,
DLL_PROCESS_ATTACH
DLL_PROCESS_DETACH
DLL_THREAD_ATTACH
DLL_THREAD_DETACH
I think we could simply understand what MSDN described about the four values... more >>
AddRef and Release function of COM inteface
Posted by George at 10/18/2007 5:41:03 AM
Hello everyone,
I have noticed a lot of COM samples that the function AddRef and Release
function of COM inteface is not synchronized to make it thread safe when
dealing with adding/decreasing reference count.
Is it needed to synchronize AddRef and Release? Or the COM runtime
underlyin... more >>
virtual destructor
Posted by George at 10/18/2007 5:16:00 AM
Hello everyone,
What is the purpose of virtual destructor? If currently, no derived class?
thanks in advance,
George... more >>
|