|
Hi Everybody, i am struggling from last week to get some positive feedback from expert exchange. .. pls help me out here.
WE are using AT commands to get the signal strength. While testing in Terminal service in two Scenarios:
1. We can't create a AT command session once Modem is connected.
2. We can't connect the Modem to internet if AT command session is open
The problem is we can't use the same port to open two session. Is there a way to create AT command session with device directly instead of going through Port? Or Can we open a port in share mode?
I have also check it in VB6 and .net 2005 through code, the behavior is same i am getting "Can't open port" error.
Any assistance would be great help.
|
|
|
|
|
we use the function ShowWindow(SW_HIDE) to my project window
but I don't know how to communicate with the the window that be hide.
Anybody know what the function use for this issue.
|
|
|
|
|
Get your Window's Handle by ::FindWindow(...) then communicate with it vi it's handle .
|
|
|
|
|
You can use FindWindow.
Alternatively when you are hiding the window you should be having a pointer to the window or some handle to it. Using that window handle/pointer you can send message to your hidden window....
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
if you have a handle to your window you can use from it.
|
|
|
|
|
Hello
In PPC, I want to overlap two pictures and then save the overlapped
picture in the specified folder.But I use the CImage, I find that many
functions are unuseful in PPC ,and GDI functions also don't support
that.
Are there functions in PPC support to overlap pictures??
Any suggestion is useful!! Thanks!!
|
|
|
|
|
|
PPC=> Pocket PC based on WinCE
Any suggestion is useful!! Thanks!!
|
|
|
|
|
Hi, I'm tryning to get an image of a webcam and apply it into an openGL texture.
I'm initializing the window with capCreateCaptureWindow
connect to the webcam with capDriverConnect
Then I use the following code to get an HBITMAP.
capGrabFrame
capEditCopy(hWndCam)
OpenClipboard(hWndCam)
hbitmap = (HBITMAP)GetClipboardData(CF_BITMAP)
How do I get a pointer to the data to be able to feed my glTexImage2D
|
|
|
|
|
I think ::GetBitmapBits can solve your problem .
|
|
|
|
|
thanks, I forgot to tell, I'm using it with Qt and I can't mix it with MFC. Is there any gdi solution?
|
|
|
|
|
GetBitmapBits is API that used in gdi .
It's declaration is :
WINGDIAPI LONG WINAPI GetBitmapBits( IN HBITMAP, IN LONG, OUT LPVOID);
|
|
|
|
|
thanks A_Fa. I tried and my buffer is always empty. The microsoft documentation recommends using GetDIBits, but I get the same result. Do I have to set some HDC or something?
|
|
|
|
|
the MSDN description:
hIconSm: Handle to a small icon that is associated with the window class
hIcon: Handle to the class icon.
But I still confused!
when I creat a window "WNDCLASSEX wc", I could always only see the icon load by the wc.hIconSm when excuting, where to find the big icon load by wc.hIcon?
|
|
|
|
|
hIcon is the large icon (32 x 32) that you can see when hitting Alt+Tab for instance. hIconSm (16 x 16) is shown in the taskbar/tray and in the titlebar of the window.
|
|
|
|
|
|
And see here[^] maybe it is some helpful to you
|
|
|
|
|
Hi guys!
I'm using CStdioFile to read a text file that also may contain some binary data. Problem is, sometimes I hit EOF even though its not the case (e.g. CStdioFile::ReadString returns FALSE but there's still data to be read), possibly because of the binary data in the text file that may contain a EOF char.
Any idea how to solve this? Or do I have to resort to using CFile in binary mode and interpret the text myself?
Thanks
|
|
|
|
|
Tanzim Husain wrote: Or do I have to resort to using CFile in binary mode and interpret the text myself?
umm yeah... since there is binary data in the file it is "by definition" NOT a Text File.
|
|
|
|
|
Hi,
I'm having some problems with DLLs and templates.
The thing is that I have found almost no info on the web, specially about warning C4251 (there's an article, but it doesn't
answer the question I have). The thing is, I have these modules:
A.dll
B.dll (Uses A.dll)
C.dll (Uses A.dll and B.dll)
D.lib (A static library that uses A.dll and C.dll)
E.exe, the executable (uses A and D)
I have a template in A. The thing is that I have found the warning C4251 when I was compiling the template in A, so I instantiated
the whole template and exported it (and dllimported when I was compiling a module other than A (all of this in the header
file, where the template is defined)). An error
arises when I'm linking E.exe, saying that I have duplicate symbols: the member functions of the template in A. The paradox here
is that if I clean all the explicit instantiations of the template and the dllexports/dllimports everything works fine! (It gives me
the C4251 warning when compiling, but it works fine). My questions are: is it necessary to explicitly instatiate the whole template,
, export it and import it when compiling other module? Or is it enough to leave an instantiation per translation unit, given that the dlls and exes are compiled
with the same compiler flags? In this case, what happens with static variables? Is the linker clever enough to use the same static
variable for the different instatiations?
any hint will be very appreciated
Thanks,
Federico
|
|
|
|
|
Because of the nature of templates, you can't put them in DLLs to be exported. Templates are placeholders. For example, when you write vector<MyClass> myVector; the compiler sees it and creates that vector. The vector of MyClass objects is then a specific type. When you just have the template definition, there is no type associated with it yet.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Of course, you're right; but in A I'm using the template as a member of a class thats exported, so the template (at least some of its method) are instantiated in A.dll
This template is also used in E.exe and in B.dll. I think that the question in the original mail is still valid...
|
|
|
|
|
Sorry, I misunderstood your question. While I don't like using this solution much, you might end up having to use #pragma warning(disable...) for that warning.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
You have two solutions:
1) Use the pimpl idiom
2) Use the Microsoft export "hack"
1) By pimpl idiom I mean:
class Class {
struct Pimpl;
Pimpl* m_pimpl;
public:
Class();
~Class();
void SetX(int x);
};
struct Class::Pimpl { int x; }
Class::Class() : m_pimpl(new Pimpl)
{
}
Class::~Class() { delete m_pimpl; }
void Class::SetX(int x) { m_pimpl->x = x; }
That also has the benefit to minimize dependencies between sourcefiles. If you change a data member, only the .cpp containing the Pimpl struct will be recompiled - not all other files which include the header file. More on this idiom can be read here: http://www.gotw.ca/gotw/028.htm[^]
2) This hack is non portable AFAIK. On the other hand, exporting C++ classes is non portable as well, so I guess it's not a problem for you. You can read more about it here: http://support.microsoft.com/kb/q168958/[^]
--
Torn from tomorrow's headlines
|
|
|
|
|
As mentioned, the MS hack is the easiest (though non-portable) way.
e.g.
MyArrayT.h (example template class)
template<class TT> class MyArrayT {...};
MyTempExp.h (not really needed)
typedef MyArrayT<long> MyArrayLong;
MyTempExp.cpp (this is the important part)
template class __declspec(dllexport) MyArrayT<long>;
This will create exports of all methods/data for MyArrayT<long>.
...cmk
Save the whales - collect the whole set
|
|
|
|