|
Hi,
I want to display vertical text.
pDC->DrawText("SV",svRect,DT_TOP|DT_LEFT);
Here i want to display "SV" vertically.
Not Like
S
V
It should display as it as but vertically..We have to turn our head to read the text.
Pls help me
Anu
|
|
|
|
|
You must create a vertical font, and then use it in DrawText():
CFont fontVert;
fontVert.CreateFont(12,
0,
900,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ARABIC_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
CLEARTYPE_QUALITY,
DEFAULT_PITCH | FF_ROMAN,
_T("Tahoma"));
www.logicsims.ir
|
|
|
|
|
Hello everybody !
We often see some Window Suspended Animation,then we can't click any Sub-Window,example the button,menu and more.
If I know the window handle ,When I try to use function PostMessage to send "WM_NULL" to the window,it doesn't Suspended Animation.Why is this so?
How can I send window message to suspend other window ?
|
|
|
|
|
Just hazarding a guess:
The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
WM_NULL[^]
|
|
|
|
|
I have a web browser control inside MFC application
In case of the web server is down I need to show error message different then the usual 404 default error.
In order to do it I use put_innerHTML method, the problem is that in the control i see my content but right click and view source I see the original HTML text and I get javascript errors like 'goBackContainet is undefined'
Any ideas?
Also i want to disable javascript error's messages on this web control, independence on what was configure in the IE settings.
Thanks for any help.
|
|
|
|
|
I am trying to use libraries provided by IBM to write a program that controls the front end client of an AS/400 system. My problem is not with the code itself; I have tried various sample programs and they all do the same thing.
Using Microsoft Visual C++ 2008 Express, I get the error mentioned above in the title:
1>------ Build started: Project: testAS400, Configuration: Debug Win32 ------
1>Linking...
1> Creating library C:\Documents and Settings\seniorda\My Documents\Visual Studio 2008\Projects\testAS400\Debug\testAS400.lib and object C:\Documents and Settings\seniorda\My Documents\Visual Studio 2008\Projects\testAS400\Debug\testAS400.exp
1>ECLSAMPS.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ECLKeyNotify::NotifyError(class ECLPS *,class ECLErr)" (?NotifyError@ECLKeyNotify@@UAEXPAVECLPS@@VECLErr@@@Z)
1>ECLSAMPS.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ECLKeyNotify::NotifyStop(class ECLPS *,int)" (?NotifyStop@ECLKeyNotify@@UAEXPAVECLPS@@H@Z)
.
.
.
C:\Documents and Settings\seniorda\My Documents\Visual Studio 2008\Projects\testAS400\Debug\testAS400.exe : fatal error LNK1120: 168 unresolved externals
I have made sure I am using the /MT option, as the documentation says I should. I made sure the library was included in the linker path. I still get the same errors.
The IBM site was supposed to include .MDB files from MSVC 2003, but there are no .MDB files at all, just a makefile from IBM Visualage C++ 2003, which my compiler can not use.
Any ideas would be useful... all the library files I can find are old and I can't find any newer library files on IBM's site. Without working libraries, my program is useless, unless I can figure out Plan B, which is to control via Active X, which is illuded to in IBM's text but not explained or recommended.
Thank you.
-Dan
|
|
|
|
|
Dan Senior wrote: I made sure the library was included in the linker path
ok, but in your project you still need to tell it to link <whatever>.lib - under MSVC6 you would go Project -> Settings => [Link Tab] and add the required .lib to the Object/Library modules box
'Making Sure the library was included in the linker path' just ensures the linker knows where to find <whatever>.lib so it CAN link it ..
ok, there could be another issue here, they might be specifying what library/ies to link using a #pragma option. Best is to go through the docco and see what libraries they say, and use (one method or the other) and add them to the link - you might need to search the headers to see if they are using #pragma to link required libraries in and check the list of pragmas against the list they say you should have (from memory, the IBM docco is usually pretty good) ... Its been a long time since Ive used AS/400 client libs, I dont even have an install for them anymore
'g'
|
|
|
|
|
Thank you...
The wording in Express 2008 is "include directory", but I tried putting a filename there and it took it. Only thing is now I am basically down to one strange error stating it can't find /files/ibm/client.obj. There is no path on my computer called /files/ibm/, and there is no file called client.obj anywhere. So I will have to see if IBM has a forum where I can ask more specifically what I need to do, or if they have a newer library (since these files are quite old).
-Dan
|
|
|
|
|
as long as you have a support contract with IBM, these libraries should be easy to get updated ..
(if you dont then you may be 'stuck')
'g'
|
|
|
|
|
I need to read the text in the status bar of another application. The status bar class is Afx:StatusBar:400000.xxxx, so I guess it's the MFC CStatusBar object.
I have an existing piece of code that can read standard Windows status bars (class: msctls_statusbar32) fine. This piece uses SendMessage (SB_GETTEXT) as follows:
- Length=SendMessage(hStatusbar, SB_GETTEXTLENGTH, Index, 0); // Get the length of the text
- Allocate the buffer based on Length
- SendMessage(hStatusbar, SB_GETTEXT, Index, (LPARAM) Buffer);
// Index = the pane number of the status bar to retrieve the text
// Buffer = the place to store the text
(I've omitted all details about allocating memory in the remote process and copy data back and forth).
However, it doesn't seem to work with the Afx:StatusBar (as said earlier, it worked for msctls_statusbar32).
I would really appreciate it if someone could tell me how to get the text in CStatusBar.
Thanks a lot
|
|
|
|
|
Fisrt find the window with CWnd::FindWindow() (and CWnd::GetNextWindow)
then cast the CWnd pointer to CStatusBar*
then you can do anything you like to it!
Hope this helps you
www.logicsims.ir
|
|
|
|
|
Thanks a lot for your suggestion. Related to that:
1) If I already got a handle of that StatusBar, how can I cast it to a CStatusBar ?
2) Is there a non-MFC way to do it ? Right now, my project is non-MFC. So converting everything to MFC can be a deal breaker.
Thanks again.
|
|
|
|
|
you're welcome.
1)
CStatusBar* p = (CStatusBar*)CWnd::FromHandle(m_hWnd);
2) I'm sure can do it without MFC:
Find the window handle of it and then use ::GetWindowText()
Spy++ (Visual C++ tool) can read it's text, so you can
www.logicsims.ir
|
|
|
|
|
GetWindowText can only get text from the first pane. As I mentioned earlier, I already tried to send SB_GETTEXT to the CStatusBar control, but it didn't return anything.
|
|
|
|
|
Currently my c++ program sits on a recv() in the primary thread/loop. I want to be able to add one or more secondary threads that receive relatively low frequency data via tcp connections but want to immediately pass this information to the main thread. Is there a way I can signal the recv() in the primary thread to return via some mechanism initiated by any one of the secondary threads? Thought I could use waitformutlipleobjects but not clear how to set it up without moving the recv() functionality already in the main thread to a secondary thread.
Thanks
|
|
|
|
|
If you use WSARecv() with an OVERLAPPED structure instead of using recv() , the function will not block.
You can then wait on events using WaitForMultipleObjects or any of the other wait functions.
The secondary threads can then signal these events using SetEvent .
|
|
|
|
|
Not familiar with overlapped structure. Looked at a msdn example. Seems a bit complicated. Need to do a bit more research on this approach as well as let it settle in. If you can elaborate a bit more that would be appreciated.
Thanks
|
|
|
|
|
I have extracted the relevant code snippets from the MSDN example.
WSAStartup(MAKEWORD(2,2), &wsd);
ConnSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
connect(ConnSocket, ptr->ai_addr, (int)ptr->ai_addrlen);
WSAOVERLAPPED RecvOverlapped = {0};
RecvOverlapped.hEvent = WSACreateEvent();
WSABUF DataBuf;
char buffer[DATA_BUFSIZE];
DataBuf.len = DATA_BUFSIZE;
DataBuf.buf = buffer;
WSARecv(ConnSocket, &DataBuf, 1, &RecvBytes, &Flags, &RecvOverlapped, NULL);
WSAWaitForMultipleEvents(1, &RecvOverlapped.hEvent, TRUE, INFINITE, TRUE);
WSAGetOverlappedResult(ConnSocket, &RecvOverlapped, &RecvBytes, FALSE, &Flags);
The call will block on WSAWaitForMultipleEvents .
Any thread can signal the event on RecvOverlapped.hEven t.
|
|
|
|
|
okay. I'll see if I can get this to work. Thanks!
|
|
|
|
|
Hi guys,
Here I am again... But now with another problem :p
SHCreateDirectoryEx(NULL, "c:\\text", NULL); gives me the following error:
1>d:\app2\app2\Form1.h(302) : error C2664: 'SHCreateDirectoryExW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I found that _T("..") should work; giving me the following error:
1>App2.obj : error LNK2028: unresolved token (0A000028) "extern "C" int __stdcall SHCreateDirectoryExW(struct HWND__ *,wchar_t const *,struct _SECURITY_ATTRIBUTES const *)" (?SHCreateDirectoryExW@@$$J212YGHPAUHWND__@@PB_WPBU_SECURITY_ATTRIBUTES@@@Z) referenced in function "private: void __clrcall App2::Form1::saveButton_Click(class System::Object ^,class System::EventArgs ^)" (?saveButton_Click@Form1@App2@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>App2.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall SHCreateDirectoryExW(struct HWND__ *,wchar_t const *,struct _SECURITY_ATTRIBUTES const *)" (?SHCreateDirectoryExW@@$$J212YGHPAUHWND__@@PB_WPBU_SECURITY_ATTRIBUTES@@@Z) referenced in function "private: void __clrcall App2::Form1::saveButton_Click(class System::Object ^,class System::EventArgs ^)" (?saveButton_Click@Form1@App2@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>D:\App2\Debug\App2.exe : fatal error LNK1120: 2 unresolved externals
Does anyone have experience with this function. I want to make a (n absolute) folder and the OS where this will be written for is Vista (sorry - I might upgrade to W7 tho).
Could someone give me some hints?
Kind regards,
|
|
|
|
|
Try referencing shell32.lib in Additional Dependencies option of the project Linker properties.
If you're doing a C++/CLI application, you should be using Directory::CreateDirectory instead.
|
|
|
|
|
I got an application. So called Windows Forms Application.
I will try Directory::CreateDirectory.
Thanks again.
----------
Edit:
The IDE (Visual C++ Studio 2008 Express) cannot find Directory::CreateDirectory . I might to include some file I guess...
----------
Re-edit:
CreateDirectory("c:\test", NULL); works... Sort of - now I get the following error:
1>d:\app2\app2\Form1.h(304) : error C2664: 'CreateDirectory' : cannot convert parameter 1 from 'const char [7]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
modified on Friday, November 13, 2009 1:06 PM
|
|
|
|
|
You need to tell me if it is a managed or unmanaged application.
Do you see using namespace xxx or #include xxx on the top of the file?
And what are they?
|
|
|
|
|
Plentyyyyyy lol
#pragma once
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include "Serial/Serial.cpp"
#include "shlobj.h"
namespace App2 {
using namespace std;
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;
|
|
|
|
|
CreateDirectory(_T("c:\\test"), NULL);
|
|
|
|