Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for December, 2012

How do I contact my mail server?

I’m seeking to do something rather simple, but don’t know where to
start looking for the answer. I want to contact my email server, send
my password and username, then check how many pieces of email are
waiting to be downloaded. Can Webkit do this? Where do I start? Thanks.

.
posted by admin in Uncategorized and have Comments (4)

Why is Xcode tying to link libz.1.dylib?

While using XCode 1.X under Panther (10.3.2):

My project is a cocoa project and I’m wondering why libz.1.dylib is
being linked.
It is giving me errors and I don’t want that lib to be linked, instead I
want my own zlib to be linked.
I never set an option in that project for linking with libz.1.dylib.

anyone?

Yvo

posted by admin in Uncategorized and have No Comments

Endless loops and Carbon events

Hello,

I’m writing arcade games which usually do most of their stuff inside a game
loop which is endlessly running. I’m running in some problems with this
because the program uses Carbon events. This means when processing the menu
command for ‘New game’ the program won’t return to the main event loop (run
by the System) until the game is finished or paused. In the meantime all
other events during gameplay will not be handled. I’ve fixed this by calling
ReceiveNextEvent periodically while running the game loop, which prevents
the event queue from overflowing but which also seems to take a lot of CPU
power.

Does anyone have a good hint how to place an (almost) endless game loop
here? Do I have to deal with MP tasks here?
—————-
Sebastian Wegner

http://www.mcsebi.com/

posted by admin in Uncategorized and have Comment (1)

Qdesign2 Compressor Doesn't works

Hi,
  Actaully I have written a converter from AVI to MOV.I have also
implemented the compression for Aduio and Video.
  But there ia a small problem with the QDesign2 compressor.
Actaully since I am using an Pure COM DLL I can’t use the Standard
Sound Manager dialog.So I have programatically set all the compressors
settings.All of the video and Audio compressors works except the
QDesign2.
  The output MOV file gets created and has a sound track but no audio
can be heard.The file info shows the QDesign Compressor but the audio
level never moves a bit.
  Are there any seperate settings for the QDesign2 compressors that
has to be set?
  Ne help would be appreciated.
Thks in advance
John Stalone

posted by admin in Uncategorized and have No Comments

path of the selected item in the frontmost Finder window ?

How to get the path of the selected item in the frontmost Finder window
(Objective-C, C, shell script or AppleScript script) ?

Same question for selected item in the Desktop.

posted by admin in Uncategorized and have Comment (1)

Strange compiler problem

I am having a really weird problem. I am using PowerPlant and CW Pro 8.3 ( I
have 9 bit I don’t have the time to update to it yet)

I have an app that has an assistant window that helps users do some specific
tasks. This assistant window and different panes are all C++ based. Mainly
off of PowerPlant classes. What is happening in one of the pane classes in
the assistant window is that when I call my function to start the panel (
set up the panel correctly) it is jumping to a different class and different
method name within that class. Here is what I mean:

void
CXOBrowserCacheRemovalAssistantWindow::FinishCreateSelf()
{

// now get the panel items
    mCurrentPanel = (CXOAssitantView*) (mMultiPanleView->GetCurrentPanel());
    ThrowIfNil_( mCurrentPanel );

    mCurrentPanelIndex = mMultiPanleView->GetCurrentIndex();

    mCurrentPanel->SetWindowObject( this );

    mCurrentPanel->StartPanel();        <—– code jumps to wrong place

    MoveWindowTo( kCXOAssistantWindow_HorizStartPos,
                    kCXOAssistantWindow_VertStartPos);

}

So in the above code :

    mCurrentPanel->StartPanel();

It should jump to my class CXOBrowserCacheRemovalSelectPanel and class
method StartPanel():

CXOBrowserCacheRemovalSelectPanel::StartPanel();

Because that is the type that this panel is, but for some reason it is
jumping to

LPane*
LPane::FindPaneByID(
    PaneIDT    inPaneID)
{
    return (inPaneID == mPaneID) ? this : nil;

}

And not too the method that it should. The class
CXOBrowserCacheRemovalSelectPanel is based on LView which is based on LPane.
Here is the class hierarchy for CXOBrowserCacheRemovalSelectPanel

CXOBrowserCacheRemovalSelectPanel
CXOBrowserCacheRemovalAssitantView
CXOAssitantView
LView
LPane

The really weird thing is that it works fine in several other assistant
views that I have already. For the life of me I can not figure out why this
is doing this. I have recompiled the whole program, I have even tried
changing the name of this method just for this class and calling it directly
but that still jumps to the wrong place.

Has anyone else ever seen this? I have CW Pro 9, but have not ventured to
use it yet, because I don’t want a bunch of errors cropping up and having to
fix compile errors right at the moment. But I guess I am going to have to
give that a try. Does anyone else have any suggestions?

Thanks,
Scott Mitchell

posted by admin in Uncategorized and have Comments (3)

Learning Sockets the Cocoa Way?

I want to learn, using Cocoa functions, to do the following (in
psuedo-code):

if(connect ("my.mailserver.com"))
{
read_from_socket();
}

print_error ("connection time-out);

I know there are various frameworks and such for sockets, but I want to
learn the basics. I think there is a Core Foundation function like
ConnectToSocketNameAddress, but there are not example calls. Thanks.

Ed

posted by admin in Uncategorized and have Comments (2)

Has anyone seen "distributed builds" in Xcode work properly?

I have serious doubts about the effectiveness of the "distributed builds"
feature in XCode. Everything seems to work fine, but when I have a more
detailed look it seems it doesn’t work well.

My suspicion was first raised when I discovered that the build of a big
project, which takes about 6 minutes to build on my 867 MHz G4, actually took
LONGER (about 8 minutes) when distributed over two computers.

I did a simple test with a project having only two .cpp files. I use two
computers: "A" is the client, where I start the build; "B" is the server,
which accepts the distributed compile job. It appears that B logs its
activities concerning remote compilation in the system log. It reports it
receives the second source file of the project, plus about 3 MB of additional
data (all the (precompiled) headers, I suppose), and after compilation it
returns about 60 KB of data, which appears to be exactly the size of the
object file. Furthermore I can see gcc come to life on machine B, so there is
no doubt about it: B has successfully compiled a source file and returned the
results. However, A, the client, seems to ignore the results completely. It
starts compiling the same source file all over again and does NOT take
advantage of the work done by B.

So that explains why it takes longer on two machines than on one.

My question is: does anyone have a similar experience? Or has anyone seen
distributed compilation work as it is supposed to?

posted by admin in Uncategorized and have Comments (2)

How do I contact my mail server?

I’m seeking to do something rather simple, but don’t know where to
start looking for the answer. I want to contact my email server, send
my password and username, then check how many pieces of email are
waiting to be downloaded. Can Webkit do this? Where do I start? Thanks.

posted by admin in Uncategorized and have Comments (4)

Why is Xcode tying to link libz.1.dylib?

While using XCode 1.X under Panther (10.3.2):

My project is a cocoa project and I’m wondering why libz.1.dylib is
being linked.
It is giving me errors and I don’t want that lib to be linked, instead I
want my own zlib to be linked.
I never set an option in that project for linking with libz.1.dylib.

anyone?

Yvo

posted by admin in Uncategorized and have No Comments