|
As subject, no worries. Glad your problem was resolved.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hello,
I tried a lot... but I cannot create a transparent topmost window on a wince based PNA.
SetLayeredWindowAttributes an other stuff were not suported on wince
If I use this
hwnd = CreateWindow(L"testerClass",L"tester Program", WS_OVERLAPPEDWINDOW, -25,-25, 65, 65, NULL, NULL, ghInstance, NULL);
I get a topmost window, titlebar is not visible (thats ok) and a white rectangle....
Is it possible to get the white region transparent?
Thats all I want
Michael
|
|
|
|
|
You can use the AlphaBlend[^] function which is available in Win CE.
Here is an article in CodeProject on Using the AlphaBlend function[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
do you mean this works also with a window?
I tried this
BLENDFUNCTION bf;
dcOld = GetDC(NULL);
hwnd = CreateWindow(L"testerClass",L"tester Program", WS_OVERLAPPEDWINDOW, -25,-25, 65, 65, NULL, NULL, ghInstance, NULL);
SetWindowPos(hwnd, HWND_TOPMOST, -25, -25, 65,65,SWP_NOOWNERZORDER| SWP_SHOWWINDOW);
dcNew = GetDC(hwnd);
bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = 120;
bf.AlphaFormat = AC_SRC_ALPHA;
AlphaBlend(dcOld, -25, -25, 65, 65, dcNew, -25, -25, 65,65, bf);
UpdateWindow(hwnd);
but I allways get the window, like without alphablend.....
It sounds very well, if it will work.....
Any suggestions? Waht I did wrong?
Michael
|
|
|
|
|
|
mhh...
the last link, I think, will not work on a WinCE powered PNA, cause the article says that the newest Win32 Api from Win2000 and above is requiered. Also there is no stdafx.h for wince
It looks very interesting but I didnot found something thar could help me.
The first thing, will work on WinCe (btw. I didnot get an Error while compiling) but I do not understand all...
With the first suggestion, I tried this...
BLENDFUNCTION bf;
hwnd = CreateWindow(L"testerClass",L"tester Program", WS_POPUP, -25,-25, 65, 65, NULL, NULL, ghInstance, NULL);
bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = 120;
bf.AlphaFormat = AC_SRC_ALPHA;
AlphaBlend(destHDC, -25,-25,65,65,srcHDC,-25,-25,65,65,bf);
hwnd is "my" window and stays ontop of the other window , lets say hwnd2.
How should I use dstHDC and scrHDC?
It is enough to call it like
HDC dstHDC = GetDC(hwnd);
HDC srcHDC = GetDC(hwnd2);
This do not change anything... The window (hwnd) is still visible, full visible.
Michael
|
|
|
|
|
Hello:
I need to use WinInet.dll for HTTP in Asynchronous mode.
Right now, I have it working fine but using InternetOpenURL().
As eventually I would need to use POST commands, I would like to work using HttpOpenRequest() and HttpSendRequestEx().
When I use HttpSendRequest() (or HttpSendRequestEx()), I get False as a response, but GetLastError() gives 997 which means 'I/O Pending', what I interpret is Ok as I'm using the function asynchronously. After this, the callback function received the Code 100 which means 'INTERNET_STATUS_REQUEST_COMPLETE', which would mean the request was sent succefully.
However, reading the data, the buffer is empty. Also, I use a sniffer and I can see that there is no HTTP request sent out to the server, so I don't know why the callback receive the 'INTERNET_STATUS_REQUEST_COMPLETE' message but the function apparently failed.
Using the sniffer with the InternetOpenURL() function, I an see the request and the response from the server..
Any idea? What else can I check in order to detect why is not working?
Thanks in advance
Gus
|
|
|
|
|
Is it possible to copy settings from one project to the other.
If so how to do it?
|
|
|
|
|
All project settings of a project are stored in its .vcproj or .vcxproj file which is nothing but an xml file. So all you need to do is to replace the relevant sections by copying from one file to another by opening the file in some text editor like notepad.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you.
I am trying to follow some intructions on how to create Property sheet based application.
When I compile and run in degug mode I get:
I am getting First-chance exception at 0x5d0c373e in LastTry.exe: 0xC0000005: Access violation writing location 0x00416e8c.
In debug mode however when i exit I get a The program '[3124] LastTry.exe: Native' has exited with code 0 (0x0).
I was able to get the original source code from the demo site. When I compiled that and ran it.
There was no exception.
There is one line in my stdafx.h which is not in the original source code.
It is to do with :
#include <afxcontrolbars.h> // MFC support for ribbons and control bars
How do I resolve this issue?
I have tried to comment the above line obviously gives me more compile errors.
What could I have done wrong? Or is it something that was not right in my install of VStudio 2008?
|
|
|
|
|
You should single step using the debugger and find out the line where you get the first chance exception.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
in debug before I go here no exception error:
BOOL bResult = CPropertySheet::OnInitDialog();
I get the error inside this...
|
|
|
|
|
I am sorry I am not trying to be a pain. This is frustratung me...
Here is what I did...Any suggetions...
On a different machine i went down in versions..from 2008-2005-and finally to VStudio 6.
I used the same steps in all ..I got the same exception error except in Vstudio 6..Where I got no exception error...Imported the same project into my Visual Studio 2008 and it works fine...No First-chance error.
I am not sure what to do? ...Well for now I can work with this imported project...but is this really a solution?...I have come to the end of the rope on this one...If I did something wrong, would VStudio 6 not complain as well?
Do you think you can advice me as what to do? I don't like to give up, at the sametime I don't want to be hitting my head if it is a bug in VStudio 2008?
I can't see me to be the only one trying or using the property sheet based application?
Thanks, I will really appreciate some sort of feed back, I am new at this and it's frustrating me..Please advice. 
|
|
|
|
|
Salut
je suis en train de codé une dll C++, cette derniere doit appelé une methode dans une autre dll .NET, afin de récuperer le resultat renvoyé par la methode .NET, j'utilise Visual c++ 6.0.
Csharp c'est du code managé or c++ c'est que du natif.
je vous demande est ce que c'est possible ou non??
Remarque :
j'arrive bien a chargé la dll .net, mais le probleme que j'ai mnt c'est l'appel de la methode .net.
A vs.
|
|
|
|
|
If Google translator worked right, yes, it's possible. I do exactly that on a project I'm on right now. You'll want to export your entry points in the C++ DLL using a .def file so they are undecorated and _cdecl. You then create an interop class in C# (I prefer placing the interops in a dedicated internal static class with the [SuppressUnmanagedCodeSecurityAttribute] and then exposing a public C# interface with full error checking and so forth.
There are several articles on the web and here in code project which use this technique.
|
|
|
|
|
Hello
i wold like to invoke a function created by C# from a c++ code, if i understand your response, i must add a static my function class with SuppressUnmanagedCodeSecurityAttribute!!
But for what this line : SuppressUnmanagedCodeSecurityAttribute
i dont understand.
Thank's
|
|
|
|
|
Look it up on MSDN[^], basically it improves performance by eliminating some paranoid security.
|
|
|
|
|
wislamOS wrote: wold like to invoke a function created by C# from a c++ code
Can't do that (unless you host .NET in your C++ application and that's where I get lost.)
For all intents and purposes, you can call native C++ from C#, but not the other way around.
|
|
|
|
|
C++/CLI lets you call both ways.
|
|
|
|
|
That's why I said "native" 
|
|
|
|
|
|
I have a reader that reads an int
and I have a writer that modifies that int.
In other words I have an int called iVal :
int iVal;
And I have a thread A that constantly reads iVal and another different thread B that, sometimes modifies the value of iVal.
My concern is with problems that may arise when A is reading iVal at the same time B is modifying it.
I used to rely on InterlockedIncrement,etc whenever I have the scenario of two writers for the same variable.
But what if my writer (B) could do more than a simple incrementation and that my readers must read the value as it is just before the writer could modify it or as it is just after it would be modified ?
I'm not sure already that the depicted scenario is unsafe. It data incorrectness could happen and cause the reader to behave in unplanned way. Moreover I seek a simple way without introducing a critical section for iVal variable :
Ie I want to avoid having to wrap the simple iVal into a class and do things like the following :
Class CValue{
private :
CCRITICAL_SECTION cs;
int iVal;
public:
CValue()
{
InitializeCriticalSection(&cs);
}
~CValue()
{
DeleteCriticalSection(&cs);
}
void setValue(int iVal)
{
EnterCriticalSection(&cs);
this->iVal = iVal;
LeaveCriticalSection(&cs);
}
int getValue()
{
int _iVal;
EnterCriticalSection(&cs);
_iVal = iVal;
LeaveCriticalSection(&cs);
return _iVal;
}
}
Thank you..in advance.
Easy Profiler : a compile-time profiler for C++
www.potatosoftware.com
|
|
|
|
|
That will work, though on an x86, simply declaring iVal as volatile would be sufficient since x86 will read or write the int value as an atomic operation IF it's on a DWORD boundary.
(The reason you need other protection in incrementing/decrementing is that incrementing may not be an atomic operation.)
|
|
|
|
|
Which messages should I process to ensure my window cannot be reduced below a certain size?
I'm currently processing the WM_SIZING message which works fine when the user is dragging the edge of the window but it's possible to use explorer to highlight multiple windows on the taskbar and then select the 'Show Windows Stacked' option from the context menu. This currently results in the window size being reduced below it's minium.
|
|
|
|
|
Try WM_GETMINMAXINFO[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|