|
Hi all,
I have the following problem:
We have a Windows-Application (created with vc++ 6). The app lets open an project document (within the exe) an then you can do calculations based on the projects settings (functions are in a dll linked to the exe). Now we need to call the application from within PHP with the Projectfile path as a parameter. Therefore, no programm window should pop up and I would like to reuse the Class derived from CDocument for the project handling. It all should remain within one vc++ project.
I tried to put in a main() I copied from an vc++ windows console application project. But then it crashes when compiled as a window app and furthermore I cannot use the class derived from CDocument because the constructor is private I guess because of good reasons.
Since I'm really glueless where to start all ideas, code snippets, urls are very appreciated and thank you in advance for the time.
Anna
|
|
|
|
|
I have a C# application with RichText formatting.
Because it's a graphical application I have to do the text rendering myself on our main canvas.
I used Uniscribe to do all the formatting (I wrote a ManagedC++ component taking care of that).
Uniscribe glyphs are painted with ScriptTextOut (not with TextOutput and such)(but still use a HDC).
Now I've got 2 problems.
1st:
printing: all my GDI Text rendering (with ScripTextOut) is shrinked into the corner compare to GDI+ rendering.
I had to call SetWorldTransform() with all the matrix element (coming from the GDI+ Graphics.Transform object) multiplied by 3 to draw them correctly.
What's even weirder: 3 is the correct value, not 300.0 / 96.0 = ~3.xx (which is the DPI ration printer/screen).
2nd:
preview: no text at all is displayed in my System.Windows.Forms.PrintPreviewDialog
no clue....
Any thoughts?
|
|
|
|
|
Someone email that directly:
----------------------------
Hi,
I am facing a smiliar problem.
Detecting a "Missing Character Glyph" without looking at a window
I am developing a dialog similar to Windows Word - Insert - Symbol Table Dialog.
For this all the charaters have to be displayed for the selected font (from all the existing fonts) and subsets which support the current font.
I am able to display the characters but some are appearing blank. These are the characters which are not supported by the the current font.
Can anyone tell me how to detect missing glyphs?
Till now I have tried with WideCharToMultiByte and GetCharacterPlacement.
But nothing seems to work.
I thought of using uniscribe function ScriptStringAnalyse.
Is this the correct function I should use?
Also I dont have Usp10.h and Usp10.lib on my system. Though I do have Usp10.dll
I thought of downloading same but looks like it comes as SDK package.
I just need this .h and .lib file.
Can you send me these two files?
----------------------------
1.
This is not at all the same problem!
Anyway Uniscribe informs you about such issue most of the time (I found 1 case where it doesn't )
But it requires a bit of work.... and a bit of understanding Uniscribe..
(There might be an easier way, but I'm not of aware of it).
ScriptShape will analyze a SCRIPT_ITEM (which you create from a wchar_t* & Script_Itemize() function)
And returns you a glyph arry. If you're glyph is 0 that is the current font doesn't support the current characters.
Then you could use the COM interface IMLanFontLink2 to find an appropriate font.
Here is my wrapper's code for this COM interface:
FontFallback::FontFallback()
{
IMLangFontLink2* pfl;
HRESULT result = CoCreateInstance(
CLSID_CMultiLanguage,
NULL,
CLSCTX_ALL,
IID_IMLangFontLink2,
(void**)&pfl);
if(!SUCCEEDED(result))
throw Script::ErrorResult(result);
langfont = pfl;
}
2. I won't send you Uniscribe.lib or .h , it's a bad idea. Better you get yourself the windows SDK (which is included in VisulatStudio), but if you only have express you'll have to download the windows SDK. it's free and it's big.
the appropriate headers and lib will be in the relevant directory of the SDK
|
|
|
|
|
i'm using the ioctl function to get the hardware address of a machine in C. i'm giving it the SIOCGIFHWADDR selector. but the compiler isn't recognizing it. it's giving an undefined identifier error on it. although i've included the header files ioctl.h. where is this constant defined? i opened ioctl.h but found no definition of the constant in it!!!!
Rola
|
|
|
|
|
|
rolati wrote:
i'm using the ioctl function to get the hardware address of a machine in C.
Using what version of VC++? I believe this is either a Unix or DOS type of function that is not available with 32-bit Windows.
Are you trying to obtain the MAC or IP address of a machine on your network, or something completely different?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Actually i'm working on a MAC machine, and i'm trying to get its MAC address. any ideas?
Rola
|
|
|
|
|
I'm not familar with the MAC's SDK. Have you tried Google?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for your help. i found a header file called sockio.h (similar to the one you mentioned for linux). it doesn't have SIOCGIFHWADDR, but i found something that could be similar SIOCGLIFADDR, which is supposed to get the IF address. but i'm not sure if that means the hardware address. so thanks for the suggestion.
Rola
|
|
|
|
|
Which OS are you using? As far as I know, SIOCGIFHWADDR is Linux-specific and defined in linux/sockios.h
|
|
|
|
|
I develop an appli.,which add the icon to system tray.
When I click right click a menu will appears.
I take menu items as Start,Minimise and ShutDown
Bottom menu item behaves like a default menu item .,it is appearing in thick letters. when double click the icon it is shutdown .B'coz I take ShutDown as last menu item.(Bottom menu Item)
If I take Start as a last menu item.It is appearing thick .
and taking defalut.when I double click on the icon Application is Starting.,
What is the Problem .
Praveen Chowdam Kumar
|
|
|
|
|
parims wrote:
What is the Problem .
As best as I can infer, there is no a problem. When the bottom menu item is Shutdown, double-clicking the icon shuts down the application. When the bottom menu item is Start, double-clicking the icon starts the application. What exactly is it that you are (not) wanting?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
i am programming a Socket with SSL .so i had to include header
file for encrytion and SSL.
#include <wincrypt.h>
#include <wintrust.h>
#include <Schnlsp.h>
in stdafx.h
even i mentioned #define _WIN32_WINNT 0x0500 in stdafx.so that crytoAPI can be used.
when i compile i got errors.when i clicked on errors i found that number of member variables of some of the structures in these header files r different from those mentioned in msdn.even some structures which r mentioned in msdn r not present in header files.
i want to know whether i have to update these header files.if it is then how
thanx for any suggestion
-- modified at 9:03 Friday 9th September, 2005
|
|
|
|
|
You cant change headers provided. There is certain version mismatch
|
|
|
|
|
i m working in VC++6 and my OS is Windows 2000 SERVER
|
|
|
|
|
sunit5 wrote:
#include <wincrypt.h> // not needed since it is included by wintrust.h
#include <wintrust.h>
#include <Schnlsp.h>
Are you including windows.h before these? Have you installed the Feb 2003 Platform SDK, and adjusted the search paths to look in it first for include and library files?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-- modified at 10:11 Friday 9th September, 2005
|
|
|
|
|
Thanx a Lot Mr David Crow.thanx once again
|
|
|
|
|
So is the problem fixed? What was the solution?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanx for ur suggestion as i was baffled by this problem.i have to arrange CD for February 2003 SDK.As soon as i get and install it,I will notify you that whether the problem has been fixed.
|
|
|
|
|
Thanx for ur Sugeestion.
Yes the problem is fixed.The Solution was to Update the SDK using FEB 2003 Platform SDK.
I installed Core SDK (from Patform SDK) for updating wincrypt.h and wintrust.h .
And for Schnlsp.h(or one can include Schannel.h as Schnlsp.h includes Schannel.h)i installed Internet Development SDK from
Platform SDK
|
|
|
|
|
I am writing an NT Service which uses ADO to connect to an Oracle Database. I use the following statement to create an ADODB.Connection object.
_ConnectionPtr m_Conn = NULL;
m_Conn.CreateInstance(__uuidof(Connection));
The Create Instance statement fails to create a new Connection object and the m_Conn object is NULL even after the statement is executed.
However, when i try to run the application as a normal Windows Application it works fine.
I get the above problem only when running the application as a Windows Service. Can someone please help me?
Thanks in advance.
|
|
|
|
|
to asses problem just some checks,
use try catch,i.e.
catch _com_error and see what its decription says.
I strongly feels it is some thing related to security, access rights
|
|
|
|
|
Yes, you might end up discovering your service needs to be configured to run as a particular user - a user with some privileges on your local machine or on your domain - so that the service will have network rights or access to certain files. Just because some process runs as a service does not necessarily imply it has free reign of your machine or the LAN.
|
|
|
|
|
Adding a try catch block does not provide any assistance since no exception is thrown when i try to create a Connection object. The following is an extract of my code.
try
{
HRESULT hRes = m_Conn.CreateInstance(__uuidof(Connection));
if (m_Conn)
{
m_Conn->ConnectionString = strConn;
}
else
{
m_sErrorMsg = "Cannot create connection";
return FALSE;
}
}
catch( _com_error &e)
{
// get info from _com_error
m_sErrorMsg.Empty();
m_sErrorMsg.Format("%s : %s", (char *)e.Source(), (char *)e.Description ());
return FALSE;
}
Currently the service runs using the 'Local System' account. I have tried changing it to my user account, but it still doesn't work. The Connection object is null.
Any help is greatly appreciated.
Thanks.
|
|
|
|
|
chamilkab wrote:
Any help is greatly appreciated.
Perhaps you do it else where, but have you made the call to CoInitialize(NULL)?
Also, what is your HRESULT returning?
-------------------------------
DEBUGGING : Removing the needles from the haystack.
-- modified at 7:37 Monday 12th September, 2005
|
|
|
|