|
hi, i need to embed QuickTime movie on an ASP page (.mov file on server). i'm scanning thru QuickTime samples now.
can anyone point me to the right direction? i found some QuickTime samples here:
http://developer.apple.com/samplecode/Sample_Code/QuickTime/Basics/CocoaCreateMovie.htm
mainly for desktop apps. i dont know too much about ASP, but i have the feeling that "my code" dont have to stream anything in binary - there must be third party component that does this for u and I'm wondering if QuickTime does this for u with one of their API?
Thanks.
norm
|
|
|
|
|
I have a program running on a friend's Win98SE machine that fails to draw everything completely, however it draws everything fine on my machies Win98 and WinXP. After numerous attempts to isolate the problem, we stumbled onto a very strange occurance.
If the program is renamed, it will run consistently with some names but not other names. There is no pattern to the names and the code does not use the program name in any way.
The question for anyone, is there any possible explanation for this strange behavior. I am pulling out my hair to try and find an answer.
Pat
|
|
|
|
|
Pat O`Neil wrote:
If the program is renamed, it will run consistently with some names but not other names.
Change to a name that it runs on consistently and leave it. It sounds like there is some odd correlation to the name of the executable and some process you are trying to do, did you write the code?
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
|
Pat O`Neil wrote:
Yes, I wrote the code.
I am assuming that you didn't include the name of the executable within the code itself?
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
Hello,
I have an RTF file that I write to, as sort of a log file. In the main program, the user is allowed to choose a font that he wants the RTF to be written in. I notice that when wordpad saves a document with different fonts, the fonts appear in the font table like this
{\fonttbl{\f0\fswiss\fcharset0 Arial;}{\f1\froman\fprq2\fcharset2 Wingdings 2;}
Mainly, I can understand all that except for the two middle portions of \f0 and \f1. \fswiss\fcharset0 and \froman\fprq2 are indistinguishable from the font name received from the Font Dialog that I use. How do I figure this out from within my program so that I may write the things that the RTF file needs to know?
|
|
|
|
|
AFAIK, \fswiss and \fcharset are used to help pick an appropriate font on systems where the exact font specified is not available. \fcharset uses one of the values defined in WINGDI.H (0 == ANSI_CHARSET), while [\fswiss|\froman|\fmodern|\fscript|\fdecor] equate to the [FF_SWISS|FF_ROMAN|FF_MODERN|FF_SCRIPT|FF_DECORATIVE] font family constants. You can obtain these from a LOGFONT structure if you have one, or probably just leave them out - if you have the font name, i *believe* it should work anyway.
---
|
|
|
|
|
You seem to be correct, about the leaving it out thing. It seems you have to put in \fcharsetN if N is not 0 that is. I was looking up the logfont thing right before I came to check back on this thread. Makes me wonder why they put in fswiss, froman, etc. if it's not really necessary. Here's a crazy one for ya... how bout fprq2? Hehe, I've seen that. By the way, if it comes down to me having to get the stuff out of the LOGFONT structure... how would i get the FF_SWISS/FF_ROMAN/ETC. out of the lfPitchAndFamily byte? I know it's bytes 4 - 7, but how would i localize those bits so that I would be able to label them by their macros? Thanks a lot for your help dude; I really appreciate it.
|
|
|
|
|
|
hi there,
i have a problem to pass a String (a very large one) from a Visual C++ Dll to a VB-Application.
The problem is that only the first 1024 letters reaching the VB-App - so where is rest? I am not very skilled in vb-programming so: is there a limited size of a string in VB?
What do you think is the problem?
Here is an example of the dll an vb - code:
//VC++ DLL -------------------------------------------------------------------
BSTR __stdcall RunDll2 (LPCSTR str )
{
CString s(str);
AfxMessageBox( s, MB_OK, 0);
//only for testing reasons:
CFile file;
CString strs;
if ( file.Open( "listerror.rtf", CFile::modeRead ) )
{
int size = file.GetLength();
char * cbuffer = new char[size-4];
file.Read(cbuffer, size);
strs = cbuffer;
file.Close();
}
s = strs;
//----------------------------------
LPSTR str1= new char[s.GetLength()];
strcpy(str1, s);
BSTR bstr = SysAllocString((OLECHAR*)str1);
return bstr;
}
-------------------------------------------------------------------
VB Code-------------------------------------------------------------------
Option Explicit
Private Declare Function myfunction Lib "DllTest.dll" Alias "RunDll2" (ByVal mystring As String) As String
Private Sub Main()
Dim mystring As String
Dim mystring2 As String
Dim out As String
mystring = "jkljökjklöjlksadfdasfdasf afkjsdölkfdf"
out = mystring
mystring2 = myfunction(mystring)
MsgBox mystring2
End Sub
|
|
|
|
|
You might want to try passing in a reference to a string instead of returning one from C++.
I had to populate a shared data structure (UDT) between VB and C, however, one of the members of the UDT was a String. I passed a reference to an array of UDT's to my C DLL, and used SysAllocString on the String member. The data passed fine. All in All i was returning about 40K of data in the one function call.
I dont have any useful code for you though.
Question: Are you using IDL?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Question for a C++ guru (Christian, etc.). What is the difference between the following types of enum declaration - I don't have a C++ language reference handy and they all seem to do the same thing:
enum EColour
{
red,
green,
blue,
};
typedef enum EColour
{
red,
green,
blue,
}
typedef enum EColour
{
red,
green,
blue,
} EColour
If I use any of the above, I can declare a variable of type colour, so why would I favour one over the other?
Not important, I'm just curious.
When I am king, you will be first against the wall.
|
|
|
|
|
Robert Edward Caldecott wrote:
enum EColour{ red, green, blue,};
I use that one, I just looked at Stroustrup's book, and he favors that also.
The other ones look like old C constructs.
Max.
|
|
|
|
|
It depends on the language:
C:
#1 requires you say "enum EColour" when declaring an EColour variable.
#2 I don't think will compile.
#3 might not compile but the idea is that you now have a typedef.
C++:
#1 This is the way to go. Enough said.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
The difference is to do with C/C++ differences.
In C, enums have a separate namespace of their own (as do
structs.) So when you say:
enum EColour {...}
You are introducing the name EColour into the enum namespace
in C. That means that subsequently to declare a type of this
kind you must qualify the name with enum, viz:
enum EColour myColour;
If you try to declare a variable thus in C:
EColour myColour;
You should get an error, because EColour is not a type name
in the global namespace it is in the enum namespace which is
separate. (Note some compilers blur the differences between
C and C++ and might accept the above.)
The second version:
typedef enum EColour { ... }
is a weird meaingless structure, that is allowed for various
reasons, however, the compiler basically ignores the typedef
keyword here. (typedef int; is also allowed, but is also
largely meaningless.) This is equivelent to the previous.
The third is a kind of old C hack.
typedef enum EColour {... } EColour;
In this case you are introducing two type names. In the enum
namespace you are introducing a type called EColour, and in
the global namespace another name, EColour that is typedefed
to enum EColour. (This statement is a combination of two
statements and is equivelent to:
enum EColour {...};
typedef enum EColour EColour;
In this case you can declare a variable of this type in two
ways:
enum EColour myColour;
EColour myColour;
Both are essentially equivelent, though they have different
types, the first is type "enum EColour" the second "EColour."
However, they are assignment compatible because C uses structural
type equivelence rather than name type equivelence (as in Pascal.)
That is to say, both enums are resolved to int in C.
Note that this is not idiomatic C. Normally this would be
written as typedef enum {red, green, blue } EColour; using
an anonymous enum in the enum space. However the structure
referred to is common with structs, viz:
typedef struct _List
{
struct _List* next;
int data;
} List;
This example above is largely the reason for this weirdness
in C. If we didn't have a name for the struct, viz:
typedef struct
{
List* next;
int data;
} List;
Is what we would like to write, however, when the compiler
finds the declaration of next it has not yet seen the declaration
of List, and so this is an error. Consequently, C added the
little hack to allow you to define the structure tag up front
as in the previous example, and then introduce the full name
at the end with type typedef. (Note in the first example you
must say struct _List not just _List. Note also, that it was
common practice to use a slighly modified name of the struct
like with an affixed "_" for the structure tag. The reason
is to be compatible with even more limited compilers from
the seventies.)
Things are slightly different in C++.
C++ places enum (and struct) names into the global namespace.
There is no special namespace for enums or structs.
When you do:
enum EColour {...};
In C++ that introduces a type name "EColour" into the global
namespace, as opposed to introducing "EColour" into the enum
namespace (As in C.)
Consequently,
typedef enum EColour {...} EColour;
is a duplication in C++ since you are introducing the name
twice. However, introducing a typename twice, assuming you
give it exactly the same definition is OK in C++. (Part of
the reason why this is so, is to allow for the aforementioned
construct, making C backward compatibility stronger.)
Finally, I said that C++ introduced the name into the global
namespace, that is not strictly true. In fact it introduces
it into the prevailing namespace at the point in code it is
declared. For example:
class VisualDescription
{
public:
enum EColour { red, green blue };
}
Introduces EColour into the VisualDescription namespace, since
it was declared in that class. That is why the correct way
to qualify these names is like this:
VisualDescription::EColour col = VisualDescription::red;
rather than:
EColour col = EColour::red;
In summary, the correct way to do this in C++ is
enum EColour { red, green. blue };
The other two examples you give a hacks left over from the
flaws in C's type system.
Oh, and one final thing, the List struct above is correctly
written thus in C++:
struct List
{
List* next;
int data;
};
Here the name List is introduced immediately in the first
line, and so is directly available when we declare "next".
Of course when List is introduced in the first line it
is introduced as an incomplete type, because the compiler
has not yet read the whole definition. However, pointers
to incomplete types are valid. (And incomplete types is
a whole other article.)
HTH
|
|
|
|
|
I have a slider ctrl in my MDI app. There is a scrollbar in the frame also, which is sending forth WM_SCROLL messages. I want two different functions to run, depending on which object was scrolled: the mainframe, or the slider on my CFormView. How do I distinguish between the two WM_HSCROLL messages?
Thanks!
Appreciate your help,
ns
|
|
|
|
|
I have a wizard in my application that, when in one configuration, shows 3 read-only edit-controls on a propertysheet. However, when the propertysheet is activated (it's the 4th of 7 pages), always one of the 3 controls has the focus (all other controls are statics, except for the wizard navigation buttons on the parent). I've tried various means to get the focus to the Next button, but the only way I managed to do it is by using ShowWindow(SW_HIDE) on all three controls in SetActive, en then ShowWindow(SW_SHOW) in OnPaint ..
Is there any way to prevent initial focus on these 3 edit controls?
|
|
|
|
|
can body tell the simple code for executing a process in vc++?
r00d0034@yahoo.com
|
|
|
|
|
|
Hello,
You now that we can register a tool with a ToolTip control by using TTM_ADDTOOL.
Now how can we remove the registered tooltips?
I know about using TTM_DELTOOL but I'm looking for another ways.
Thank you in advance.
BOOL CMyToolTip::AddRectTool(CWnd *pWnd,LPCTSTR pszText,LPCRECT pRect,UINT nIDTool)<br />
{<br />
TOOLINFO ti;<br />
ti.cbSize = sizeof (TOOLINFO);<br />
ti.uFlags = TTF_SUBCLASS;<br />
ti.hwnd = pWnd->GetSafeHwnd();<br />
ti.uId = nIDTool;<br />
ti.hinst = AfxGetInstanceHandle();<br />
ti.lpszText = (LPTSTR) pszText;<br />
::CopyRect (&ti.rect, pRect);<br />
<br />
return (BOOL)SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ti);<br />
}
|
|
|
|
|
how to i make an ocx it plays a swf file using flash player ocx?
Thanks.
|
|
|
|
|
the following situation:
In Win CE.
Dialog based App.
Dialog resource has 1 control, a Tab Control
when selecting a tab-page all controls for that page are created dynamically (parent = tabcntrl).
So the message handling functions for the controls and the corresponding code in messagemap are added manually. the ID's are matching. The code syntax seems to be correct.
problem:
The control are showed but the message handlers aren't called.
Did I forget something ?
|
|
|
|
|
how can one prevent a visual c++ programm from being run more than once on same PC
|
|
|
|
|
There are a number of ways to do this, a named mutex is the most common. The name for this is a singleton, if you search this site or google for the word 'singleton' I reckon you'll find heaps of examples.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|